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

Side by Side Diff: chrome/browser/policy/cloud_policy_subsystem_unittest.cc

Issue 11759019: Update other unittests to use newly added TestingBrowserProcess::GetGlobal(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpler codez Created 7 years, 11 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <vector> 5 #include <vector>
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 prefs::kDevicePolicyRefreshRate, 0); 133 prefs::kDevicePolicyRefreshRate, 0);
134 134
135 // Abort the test on unexpected requests. 135 // Abort the test on unexpected requests.
136 ON_CALL(factory(), Intercept(_, _, _, _)) 136 ON_CALL(factory(), Intercept(_, _, _, _))
137 .WillByDefault(InvokeWithoutArgs( 137 .WillByDefault(InvokeWithoutArgs(
138 this, 138 this,
139 &CloudPolicySubsystemTestBase::StopMessageLoop)); 139 &CloudPolicySubsystemTestBase::StopMessageLoop));
140 } 140 }
141 141
142 virtual void TearDown() { 142 virtual void TearDown() {
143 static_cast<TestingBrowserProcess*>(g_browser_process)->SetLocalState(NULL); 143 TestingBrowserProcess::GetGlobal()->SetLocalState(NULL);
144 cloud_policy_subsystem_->Shutdown(); 144 cloud_policy_subsystem_->Shutdown();
145 cloud_policy_subsystem_.reset(); 145 cloud_policy_subsystem_.reset();
146 data_store_.reset(); 146 data_store_.reset();
147 factory_.reset(); 147 factory_.reset();
148 logger_.reset(); 148 logger_.reset();
149 prefs_.reset(); 149 prefs_.reset();
150 } 150 }
151 151
152 void ExecuteTest() { 152 void ExecuteTest() {
153 // Stop the test once all the expectations are met. This relies on a 153 // Stop the test once all the expectations are met. This relies on a
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 TEST_F(CloudPolicySubsystemSerialNumberRecoveryTest, SerialRequested) { 460 TEST_F(CloudPolicySubsystemSerialNumberRecoveryTest, SerialRequested) {
461 InSequence s; 461 InSequence s;
462 ExpectSuccessfulRegistration(); 462 ExpectSuccessfulRegistration();
463 ExpectPolicyRequest("", true, true); 463 ExpectPolicyRequest("", true, true);
464 ExpectPolicyRequest(kMachineId, false, false); 464 ExpectPolicyRequest(kMachineId, false, false);
465 ExpectPolicyRequest("", false, false); 465 ExpectPolicyRequest("", false, false);
466 ExecuteTest(); 466 ExecuteTest();
467 } 467 }
468 468
469 } // policy 469 } // policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/auto_enrollment_client_unittest.cc ('k') | chrome/browser/policy/user_policy_signin_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698