OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |