| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" | 5 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> | 216 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> |
| 217 RegisterTestingFactory(nullptr); | 217 RegisterTestingFactory(nullptr); |
| 218 chromeos::DeviceOAuth2TokenServiceFactory::Shutdown(); | 218 chromeos::DeviceOAuth2TokenServiceFactory::Shutdown(); |
| 219 chromeos::DBusThreadManager::Shutdown(); | 219 chromeos::DBusThreadManager::Shutdown(); |
| 220 chromeos::SystemSaltGetter::Shutdown(); | 220 chromeos::SystemSaltGetter::Shutdown(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 Profile* AffiliatedInvalidationServiceProviderImplTest::LogInAndReturnProfile( | 223 Profile* AffiliatedInvalidationServiceProviderImplTest::LogInAndReturnProfile( |
| 224 const std::string& user_id) { | 224 const std::string& user_id) { |
| 225 fake_user_manager_->AddUser(user_id); | 225 fake_user_manager_->AddUser(AccountId::FromUserEmail(user_id)); |
| 226 Profile* profile = profile_manager_.CreateTestingProfile(user_id); | 226 Profile* profile = profile_manager_.CreateTestingProfile(user_id); |
| 227 content::NotificationService::current()->Notify( | 227 content::NotificationService::current()->Notify( |
| 228 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 228 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 229 content::NotificationService::AllSources(), | 229 content::NotificationService::AllSources(), |
| 230 content::Details<Profile>(profile)); | 230 content::Details<Profile>(profile)); |
| 231 return profile; | 231 return profile; |
| 232 } | 232 } |
| 233 | 233 |
| 234 void AffiliatedInvalidationServiceProviderImplTest:: | 234 void AffiliatedInvalidationServiceProviderImplTest:: |
| 235 LogInAsAffiliatedUserAndConnectInvalidationService() { | 235 LogInAsAffiliatedUserAndConnectInvalidationService() { |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 EXPECT_EQ(0, consumer_->GetAndClearInvalidationServiceSetCount()); | 652 EXPECT_EQ(0, consumer_->GetAndClearInvalidationServiceSetCount()); |
| 653 provider_->Shutdown(); | 653 provider_->Shutdown(); |
| 654 EXPECT_EQ(1, consumer_->GetAndClearInvalidationServiceSetCount()); | 654 EXPECT_EQ(1, consumer_->GetAndClearInvalidationServiceSetCount()); |
| 655 EXPECT_EQ(nullptr, consumer_->GetInvalidationService()); | 655 EXPECT_EQ(nullptr, consumer_->GetInvalidationService()); |
| 656 | 656 |
| 657 // Verify that the device-global invalidation service has been destroyed. | 657 // Verify that the device-global invalidation service has been destroyed. |
| 658 EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest()); | 658 EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest()); |
| 659 } | 659 } |
| 660 | 660 |
| 661 } // namespace policy | 661 } // namespace policy |
| OLD | NEW |