| 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.h" | 5 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" | 10 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 install_attributes_("example.com", | 136 install_attributes_("example.com", |
| 137 "user@example.com", | 137 "user@example.com", |
| 138 "device_id", | 138 "device_id", |
| 139 DEVICE_MODE_ENTERPRISE), | 139 DEVICE_MODE_ENTERPRISE), |
| 140 profile_manager_(TestingBrowserProcess::GetGlobal()) { | 140 profile_manager_(TestingBrowserProcess::GetGlobal()) { |
| 141 } | 141 } |
| 142 | 142 |
| 143 void AffiliatedInvalidationServiceProviderTest::SetUp() { | 143 void AffiliatedInvalidationServiceProviderTest::SetUp() { |
| 144 chromeos::SystemSaltGetter::Initialize(); | 144 chromeos::SystemSaltGetter::Initialize(); |
| 145 chromeos::DBusThreadManager::Initialize(); | 145 chromeos::DBusThreadManager::Initialize(); |
| 146 chromeos::DeviceOAuth2TokenServiceFactory::Initialize(); | |
| 147 ASSERT_TRUE(profile_manager_.SetUp()); | 146 ASSERT_TRUE(profile_manager_.SetUp()); |
| 148 | 147 |
| 149 test_device_settings_service_.reset(new | 148 test_device_settings_service_.reset(new |
| 150 chromeos::ScopedTestDeviceSettingsService); | 149 chromeos::ScopedTestDeviceSettingsService); |
| 151 test_cros_settings_.reset(new chromeos::ScopedTestCrosSettings); | 150 test_cros_settings_.reset(new chromeos::ScopedTestCrosSettings); |
| 151 chromeos::DeviceOAuth2TokenServiceFactory::Initialize(); |
| 152 | 152 |
| 153 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> | 153 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> |
| 154 RegisterTestingFactory(BuildProfileInvalidationProvider); | 154 RegisterTestingFactory(BuildProfileInvalidationProvider); |
| 155 | 155 |
| 156 provider_.reset(new AffiliatedInvalidationServiceProvider); | 156 provider_.reset(new AffiliatedInvalidationServiceProvider); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void AffiliatedInvalidationServiceProviderTest::TearDown() { | 159 void AffiliatedInvalidationServiceProviderTest::TearDown() { |
| 160 provider_->Shutdown(); | 160 provider_->Shutdown(); |
| 161 provider_.reset(); | 161 provider_.reset(); |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 | 618 |
| 619 // Verify that the device-global invalidation service still does not exist. | 619 // Verify that the device-global invalidation service still does not exist. |
| 620 EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest()); | 620 EXPECT_FALSE(provider_->GetDeviceInvalidationServiceForTest()); |
| 621 | 621 |
| 622 // Unregister the consumer. | 622 // Unregister the consumer. |
| 623 provider_->UnregisterConsumer(&consumer_); | 623 provider_->UnregisterConsumer(&consumer_); |
| 624 Mock::VerifyAndClearExpectations(&consumer_); | 624 Mock::VerifyAndClearExpectations(&consumer_); |
| 625 } | 625 } |
| 626 | 626 |
| 627 } // namespace policy | 627 } // namespace policy |
| OLD | NEW |