| Index: chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl_unittest.cc
|
| diff --git a/chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl_unittest.cc b/chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl_unittest.cc
|
| index 143a37e164c0174560fb692d8b885068dc5fd269..b9965e48edc7200ccbbaa7f009c29ab4c60a124c 100644
|
| --- a/chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl_unittest.cc
|
| +++ b/chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl_unittest.cc
|
| @@ -88,7 +88,8 @@ class AffiliatedInvalidationServiceProviderImplTest : public testing::Test {
|
| void TearDown() override;
|
|
|
| // Ownership is not passed. The Profile is owned by the global ProfileManager.
|
| - Profile* LogInAndReturnProfile(const std::string& user_id);
|
| + Profile* LogInAndReturnProfile(const std::string& user_id,
|
| + bool is_affiliated);
|
|
|
| // Logs in as an affiliated user and indicates that the per-profile
|
| // invalidation service for this user connected. Verifies that this
|
| @@ -221,8 +222,9 @@ void AffiliatedInvalidationServiceProviderImplTest::TearDown() {
|
| }
|
|
|
| Profile* AffiliatedInvalidationServiceProviderImplTest::LogInAndReturnProfile(
|
| - const std::string& user_id) {
|
| - fake_user_manager_->AddUser(user_id);
|
| + const std::string& user_id,
|
| + bool is_affiliated) {
|
| + fake_user_manager_->AddUserWithAffiliation(user_id, is_affiliated);
|
| Profile* profile = profile_manager_.CreateTestingProfile(user_id);
|
| content::NotificationService::current()->Notify(
|
| chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
|
| @@ -234,7 +236,7 @@ Profile* AffiliatedInvalidationServiceProviderImplTest::LogInAndReturnProfile(
|
| void AffiliatedInvalidationServiceProviderImplTest::
|
| LogInAsAffiliatedUserAndConnectInvalidationService() {
|
| // Log in as an affiliated user.
|
| - Profile* profile = LogInAndReturnProfile(kAffiliatedUserID1);
|
| + Profile* profile = LogInAndReturnProfile(kAffiliatedUserID1, true);
|
| EXPECT_TRUE(profile);
|
|
|
| // Verify that a per-profile invalidation service has been created.
|
| @@ -260,7 +262,7 @@ void AffiliatedInvalidationServiceProviderImplTest::
|
| void AffiliatedInvalidationServiceProviderImplTest::
|
| LogInAsUnaffiliatedUserAndConnectInvalidationService() {
|
| // Log in as an unaffiliated user.
|
| - Profile* profile = LogInAndReturnProfile(kUnaffiliatedUserID);
|
| + Profile* profile = LogInAndReturnProfile(kUnaffiliatedUserID, false);
|
| EXPECT_TRUE(profile);
|
|
|
| // Verify that a per-profile invalidation service has been created.
|
| @@ -335,7 +337,7 @@ TEST_F(AffiliatedInvalidationServiceProviderImplTest, NoConsumers) {
|
| EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest());
|
|
|
| // Log in as an affiliated user.
|
| - EXPECT_TRUE(LogInAndReturnProfile(kAffiliatedUserID1));
|
| + EXPECT_TRUE(LogInAndReturnProfile(kAffiliatedUserID1, true));
|
|
|
| // Verify that no device-global invalidation service has been created.
|
| EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest());
|
| @@ -506,7 +508,7 @@ TEST_F(AffiliatedInvalidationServiceProviderImplTest,
|
| LogInAsAffiliatedUserAndConnectInvalidationService();
|
|
|
| // Log in as a second affiliated user.
|
| - Profile* second_profile = LogInAndReturnProfile(kAffiliatedUserID2);
|
| + Profile* second_profile = LogInAndReturnProfile(kAffiliatedUserID2, true);
|
| EXPECT_TRUE(second_profile);
|
|
|
| // Verify that the device-global invalidation service still does not exist.
|
| @@ -605,7 +607,7 @@ TEST_F(AffiliatedInvalidationServiceProviderImplTest, NoServiceAfterShutdown) {
|
| EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest());
|
|
|
| // Log in as a second affiliated user.
|
| - Profile* second_profile = LogInAndReturnProfile(kAffiliatedUserID2);
|
| + Profile* second_profile = LogInAndReturnProfile(kAffiliatedUserID2, true);
|
| EXPECT_TRUE(second_profile);
|
|
|
| // Verify that the device-global invalidation service still does not exist.
|
|
|