Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: chrome/browser/chromeos/policy/device_cloud_policy_invalidator_unittest.cc

Issue 762863002: Removed policy::PolicyNamespaceKey. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass values in ctors Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/device_cloud_policy_invalidator.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_invalidator.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 RegisterTestingFactory(BuildProfileInvalidationProvider); 165 RegisterTestingFactory(BuildProfileInvalidationProvider);
166 166
167 invalidator_.reset(new DeviceCloudPolicyInvalidator); 167 invalidator_.reset(new DeviceCloudPolicyInvalidator);
168 } 168 }
169 169
170 void DeviceCloudPolicyInvalidatorTest::TearDown() { 170 void DeviceCloudPolicyInvalidatorTest::TearDown() {
171 invalidator_.reset(); 171 invalidator_.reset();
172 base::RunLoop().RunUntilIdle(); 172 base::RunLoop().RunUntilIdle();
173 173
174 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> 174 invalidation::ProfileInvalidationProviderFactory::GetInstance()->
175 RegisterTestingFactory(NULL); 175 RegisterTestingFactory(nullptr);
176 chromeos::DeviceSettingsService::Get()->UnsetSessionManager(); 176 chromeos::DeviceSettingsService::Get()->UnsetSessionManager();
177 TestingBrowserProcess::GetGlobal()->SetBrowserPolicyConnector(NULL); 177 TestingBrowserProcess::GetGlobal()->SetBrowserPolicyConnector(nullptr);
178 chromeos::DeviceOAuth2TokenServiceFactory::Shutdown(); 178 chromeos::DeviceOAuth2TokenServiceFactory::Shutdown();
179 chromeos::DBusThreadManager::Shutdown(); 179 chromeos::DBusThreadManager::Shutdown();
180 chromeos::SystemSaltGetter::Shutdown(); 180 chromeos::SystemSaltGetter::Shutdown();
181 } 181 }
182 182
183 Profile *DeviceCloudPolicyInvalidatorTest::LogInAndReturnProfile( 183 Profile *DeviceCloudPolicyInvalidatorTest::LogInAndReturnProfile(
184 const std::string& user_id) { 184 const std::string& user_id) {
185 fake_user_manager_->AddUser(user_id); 185 fake_user_manager_->AddUser(user_id);
186 Profile* profile = profile_manager_.CreateTestingProfile(user_id); 186 Profile* profile = profile_manager_.CreateTestingProfile(user_id);
187 content::NotificationService::current()->Notify( 187 content::NotificationService::current()->Notify(
(...skipping 14 matching lines...) Expand all
202 } 202 }
203 203
204 invalidation::FakeInvalidationService* 204 invalidation::FakeInvalidationService*
205 DeviceCloudPolicyInvalidatorTest::GetProfileInvalidationService( 205 DeviceCloudPolicyInvalidatorTest::GetProfileInvalidationService(
206 Profile* profile) { 206 Profile* profile) {
207 invalidation::ProfileInvalidationProvider* invalidation_provider = 207 invalidation::ProfileInvalidationProvider* invalidation_provider =
208 static_cast<invalidation::ProfileInvalidationProvider*>( 208 static_cast<invalidation::ProfileInvalidationProvider*>(
209 invalidation::ProfileInvalidationProviderFactory::GetInstance()-> 209 invalidation::ProfileInvalidationProviderFactory::GetInstance()->
210 GetServiceForBrowserContext(profile, false)); 210 GetServiceForBrowserContext(profile, false));
211 if (!invalidation_provider) 211 if (!invalidation_provider)
212 return NULL; 212 return nullptr;
213 return static_cast<invalidation::FakeInvalidationService*>( 213 return static_cast<invalidation::FakeInvalidationService*>(
214 invalidation_provider->GetInvalidationService()); 214 invalidation_provider->GetInvalidationService());
215 } 215 }
216 216
217 int DeviceCloudPolicyInvalidatorTest:: 217 int DeviceCloudPolicyInvalidatorTest::
218 GetProfileInvalidationServiceObserverCount() const { 218 GetProfileInvalidationServiceObserverCount() const {
219 return invalidator_->profile_invalidation_service_observers_.size(); 219 return invalidator_->profile_invalidation_service_observers_.size();
220 } 220 }
221 221
222 const invalidation::InvalidationService* 222 const invalidation::InvalidationService*
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 invalidator = GetCloudPolicyInvalidator(); 737 invalidator = GetCloudPolicyInvalidator();
738 ASSERT_TRUE(invalidator); 738 ASSERT_TRUE(invalidator);
739 EXPECT_EQ(profile_2_invalidation_service, GetInvalidationService()); 739 EXPECT_EQ(profile_2_invalidation_service, GetInvalidationService());
740 740
741 // Verify that the invalidator's highest handled invalidation version starts 741 // Verify that the invalidator's highest handled invalidation version starts
742 // out as one. 742 // out as one.
743 EXPECT_EQ(1, invalidator->highest_handled_invalidation_version()); 743 EXPECT_EQ(1, invalidator->highest_handled_invalidation_version());
744 } 744 }
745 745
746 } // namespace policy 746 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698