Lines Matching defs:profile

207   void AdoptProfile(Manager* manager, ProfileRefPtr profile) {
208 manager->profiles_.push_back(profile);
228 Profile* profile(new Profile(
230 profile->set_storage(storage.release()); // Passes ownership of "storage".
231 return profile; // Passes ownership of "profile".
292 scoped_refptr<MockProfile> profile(
294 EXPECT_CALL(*profile, GetRpcIdentifier()).WillRepeatedly(Return(name));
295 EXPECT_CALL(*profile, UpdateDevice(_)).WillRepeatedly(Return(false));
296 AdoptProfile(manager, profile);
297 return profile;
608 MockProfile* profile =
611 AdoptProfile(manager(), profile); // Passes ownership.
612 EXPECT_CALL(*profile, ConfigureDevice(device_ref));
613 EXPECT_CALL(*profile, UpdateDevice(device_ref));
629 MockProfile* profile =
631 AdoptProfile(manager(), profile); // Passes ownership.
634 EXPECT_CALL(*profile, UpdateDevice(DeviceRefPtr(mock_devices_[0])));
639 EXPECT_CALL(*profile, UpdateDevice(DeviceRefPtr(mock_devices_[1])));
651 ProfileRefPtr profile(CreateProfileForManager(&manager));
652 ASSERT_TRUE(profile.get());
653 AdoptProfile(&manager, profile);
701 ProfileRefPtr profile(CreateProfileForManager(&manager));
702 ASSERT_TRUE(profile.get());
703 AdoptProfile(&manager, profile);
709 ASSERT_TRUE(profile->AdoptService(service1));
710 ASSERT_TRUE(profile->ContainsService(service1));
718 EXPECT_EQ(service2->profile().get(), profile.get());
731 ProfileRefPtr profile(CreateProfileForManager(&manager));
732 ASSERT_TRUE(profile.get());
733 AdoptProfile(&manager, profile);
739 ASSERT_TRUE(profile->AdoptService(service1));
740 ASSERT_TRUE(profile->ContainsService(service1));
750 EXPECT_NE(mock_service2->profile().get(), profile.get());
836 // Inject an actual profile, backed by a fake StoreInterface
839 ProfileRefPtr profile(new Profile(
847 profile->set_storage(storage);
848 AdoptProfile(&manager, profile);
850 // Create a profile that already has |s2| in it.
851 ProfileRefPtr profile(
853 EXPECT_TRUE(profile->AdoptService(s2));
855 // Now, move the Service |s2| to another profile.
861 profile = nullptr;
876 ProfileRefPtr profile = manager()->LookupProfileByRpcIdentifier(kProfileName);
877 EXPECT_EQ(mock_profile.get(), profile.get());
896 // Expect that setting the profile of a service that does not already
902 // The service should be registered as a side-effect of the profile being
907 // profile was not actually changed. Do so explicitly now.
921 EXPECT_EQ("Service is already connected to this profile", error.message());
956 // A profile with invalid characters in it should similarly be rejected.
960 // We should be able to create a machine profile.
963 // We should succeed in creating a valid user profile. Verify the returned
965 const char kProfile[] = "~user/profile";
990 // Pushing an invalid profile should fail.
993 // Create and push a default profile. Should succeed.
999 // Pushing a default profile that does not exist on disk will _not_
1021 // Pushing a profile a second time should fail.
1026 // Active profile should be the last one we pushed.
1029 // Make sure a profile name that doesn't exist fails.
1047 // profile.
1049 ASSERT_EQ(GetEphemeralProfile(&manager), service->profile());
1051 // Create storage for a profile that contains the service storage name.
1055 // When we push the profile, the service should move away from the
1056 // ephemeral profile to this new profile since it has an entry for
1060 EXPECT_NE(GetEphemeralProfile(&manager), service->profile());
1061 EXPECT_EQ(kProfile2, "~" + service->profile()->GetFriendlyName());
1063 // Insert another profile that should supersede ownership of the service.
1072 EXPECT_EQ(kProfile3, "~" + service->profile()->GetFriendlyName());
1074 // Popping an invalid profile name should fail.
1077 // Popping an profile that is not at the top of the stack should fail.
1080 // Popping the top profile should succeed.
1084 // Moreover the service should have switched profiles to profile 2.
1085 EXPECT_EQ(kProfile2, "~" + service->profile()->GetFriendlyName());
1087 // Popping the top profile should succeed.
1091 // The service should now revert to the ephemeral profile.
1092 EXPECT_EQ(GetEphemeralProfile(&manager), service->profile());
1108 // Should be able to push a machine profile.
1111 // Should be able to push a user profile atop a machine profile.
1114 // Pushing a system-wide profile on top of a user profile should fail.
1118 // However if we pop the user profile, we should be able stack another
1119 // machine profile on.
1135 // Use InsertUserProfile() instead. Although a machine profile is valid
1171 // Remove should fail since the profile is still on the stack.
1183 // This should succeed now that the profile is off the stack.
1202 // directory in the place of the profile pathname.
1222 EXPECT_EQ(GetEphemeralProfile(manager()), service->profile().get());
1224 scoped_refptr<MockProfile> profile(
1227 AdoptProfile(manager(), profile);
1230 EXPECT_CALL(*profile, AbandonService(service)).Times(0);
1231 EXPECT_CALL(*profile, ConfigureService(service)).Times(0);
1235 Mock::VerifyAndClearExpectations(profile.get());
1236 EXPECT_EQ(GetEphemeralProfile(manager()), service->profile().get());
1239 // If service is not ephemeral and the Manager finds a profile to assign
1242 // Service's profile.
1243 service->set_profile(profile);
1244 EXPECT_CALL(*profile, AbandonService(service));
1245 EXPECT_CALL(*profile, ConfigureService(service)).WillOnce(Return(true));
1249 Mock::VerifyAndClearExpectations(profile.get());
1251 EXPECT_EQ(profile.get(), service->profile().get());
1253 // If service becomes ephemeral since there is no profile to support it,
1255 EXPECT_CALL(*profile, AbandonService(service));
1256 EXPECT_CALL(*profile, ConfigureService(service)).WillOnce(Return(false));
1281 // create a profile twice.
1338 // No services are a member of this profile.
1342 // No services that are members of this profile have this entry name.
1346 // Only services that are members of the profile and group will be abandoned.
1362 // Only allow one of the members of the profile and group to successfully
1384 EXPECT_EQ(GetEphemeralProfile(manager()), s_not_in_profile->profile().get());
1385 EXPECT_EQ(profile1, s_not_in_group->profile());
1386 EXPECT_EQ(GetEphemeralProfile(manager()), s_configure_fail->profile());
1388 // Since we are using a MockProfile, the profile does not actually change,
1390 EXPECT_EQ(profile1, s_configure_succeed->profile());
1440 scoped_refptr<MockProfile> profile(
1444 s_will_remove0->set_profile(profile);
1445 s_will_remove1->set_profile(profile);
1446 s_will_not_remove0->set_profile(profile);
1447 s_will_not_remove1->set_profile(profile);
1449 AdoptProfile(manager(), profile);
1451 // Deny any of the services re-entry to the profile.
1452 EXPECT_CALL(*profile, ConfigureService(_))
1455 EXPECT_CALL(*profile, AbandonService(ServiceRefPtr(s_will_remove0)))
1457 EXPECT_CALL(*profile, AbandonService(ServiceRefPtr(s_will_remove1)))
1459 EXPECT_CALL(*profile, AbandonService(ServiceRefPtr(s_will_not_remove0)))
1461 EXPECT_CALL(*profile, AbandonService(ServiceRefPtr(s_will_not_remove1)))
1476 EXPECT_TRUE(manager()->HandleProfileEntryDeletion(profile, entry_name));
1509 .Times(5); // Once for each registration, and one after profile pop.
1552 // profile list.
1566 // Expect the unloaded services to lose their profile reference.
1567 EXPECT_FALSE(s_will_remove0->profile());
1568 EXPECT_FALSE(s_will_remove1->profile());
1571 // with respect to the profile reference.
1572 ASSERT_TRUE(s_will_not_remove0->profile());
1574 EXPECT_FALSE(s_will_not_remove0->profile());
1708 scoped_refptr<MockProfile> profile(
1711 AdoptProfile(manager(), profile);
1724 scoped_refptr<MockProfile> profile(
1727 AdoptProfile(manager(), profile);
1738 EXPECT_CALL(*profile, UpdateService(_))
1741 EXPECT_CALL(*profile, LoadService(_))
1743 EXPECT_CALL(*profile, ConfigureService(_))
1780 // Manager calls ActiveProfile() so we need at least one profile installed.
1781 scoped_refptr<MockProfile> profile(
1784 AdoptProfile(manager(), profile);
1791 EXPECT_EQ("Invalid profile name xxx", error.message());
1795 // Manager calls ActiveProfile() so we need at least one profile installed.
1796 scoped_refptr<MockProfile> profile(
1799 AdoptProfile(manager(), profile);
1813 // A registered service in the ephemeral profile should be moved to the
1814 // active profile as a part of configuration if no profile was explicitly
1817 scoped_refptr<MockProfile> profile(
1821 AdoptProfile(manager(), profile); // This is now the active profile.
1840 EXPECT_CALL(*profile, UpdateService(ServiceRefPtr(service.get())))
1842 EXPECT_CALL(*profile, AdoptService(ServiceRefPtr(service.get())))
1853 // specify a profile, it should be moved from the profile it was previously
1854 // in to the specified profile if one was requested.
1910 // profile, the Manager should not call LoadService or AdoptService again
1958 // be saved to the specified profile nonetheless.
2035 manager()->ConfigureServiceForProfile("/profile/foo", args, &error);
2124 const string kProfileName = "profile";
2125 scoped_refptr<MockProfile> profile(
2127 mock_service->set_profile(profile);
2135 EXPECT_CALL(*profile, AdoptService(mock_service_generic)).Times(0);
2153 EXPECT_CALL(*profile, UpdateService(mock_service_generic)).Times(1);
2161 EXPECT_EQ(profile.get(), service->profile().get());
2167 const string kProfileName = "profile";
2168 scoped_refptr<MockProfile> profile(
2181 mock_service->set_profile(profile);
2189 EXPECT_CALL(*profile, AdoptService(mock_service_generic)).Times(0);
2191 EXPECT_CALL(*profile, UpdateService(mock_service_generic)).Times(1);
2198 EXPECT_EQ(profile.get(), service->profile().get());
2203 const string kProfileName = "profile";
2204 scoped_refptr<MockProfile> profile(
2226 EXPECT_CALL(*profile, UpdateService(mock_service_generic)).Times(1);
2233 EXPECT_EQ(profile.get(), service->profile().get());
2340 EXPECT_EQ(profile1.get(), matching_service->profile().get());
2904 scoped_refptr<MockProfile> profile(
2907 AdoptProfile(manager(), profile);
2917 EXPECT_CALL(*profile.get(),
2922 EXPECT_CALL(*profile.get(), UpdateWiFiProvider(_)).WillOnce(Return(true));
2924 EXPECT_CALL(*profile.get(), Save()).WillOnce(Return(true));
2948 // currently associated with a profile. We want to make sure that the
2949 // auto_connect flag is set and that the is saved to the current profile.
2959 scoped_refptr<MockProfile> profile(
2963 mock_service->set_profile(profile);
2966 EXPECT_CALL(*profile,
2970 // This releases the ref on the mock profile.
3036 scoped_refptr<MockProfile> profile(
3039 AdoptProfile(manager(), profile);
3049 EXPECT_CALL(*profile.get(), ConfigureService(expect_service))
3057 EXPECT_CALL(*profile.get(), AdoptService(expect_service))
3082 scoped_refptr<MockProfile> profile(
3085 profile_paths.push_back(base::StringPrintf("/profile/%zd", i));
3086 EXPECT_CALL(*profile.get(), GetRpcIdentifier())
3088 AdoptProfile(manager(), profile);
3547 // Simulate loading value from the default profile.
3557 // Ensure profile value is not overwritten, so when we save the default
3558 // profile, the correct value will still be written.
3568 // the profile value and what we read back.
4442 // Give manager a valid place to write the user profile list.
4446 // (for the default profile).
4484 // user profile.
4547 EXPECT_CALL(log, Log(logging::LOG_INFO, _, HasSubstr("1 profile(s)")));
4558 EXPECT_CALL(log, Log(logging::LOG_INFO, _, HasSubstr("2 profile(s)")));
4561 EXPECT_CALL(log, Log(logging::LOG_INFO, _, HasSubstr("3 profile(s)")));
4564 EXPECT_CALL(log, Log(logging::LOG_INFO, _, HasSubstr("4 profile(s)")));
4567 EXPECT_CALL(log, Log(logging::LOG_INFO, _, HasSubstr("3 profile(s)")));
4570 EXPECT_CALL(log, Log(logging::LOG_INFO, _, HasSubstr("2 profile(s)")));
4573 EXPECT_CALL(log, Log(logging::LOG_INFO, _, HasSubstr("1 profile(s)")));