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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 EXPECT_CALL(factory(), Intercept(_, _, _, _)) | 155 EXPECT_CALL(factory(), Intercept(_, _, _, _)) |
156 .Times(AtMost(1)) | 156 .Times(AtMost(1)) |
157 .WillRepeatedly( | 157 .WillRepeatedly( |
158 InvokeWithoutArgs(this, | 158 InvokeWithoutArgs(this, |
159 &CloudPolicySubsystemTestBase::StopMessageLoop)); | 159 &CloudPolicySubsystemTestBase::StopMessageLoop)); |
160 | 160 |
161 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 161 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
162 data_store_->set_user_name(kUsername); | 162 data_store_->set_user_name(kUsername); |
163 data_store_->SetGaiaToken(kAuthToken); | 163 data_store_->SetGaiaToken(kAuthToken); |
164 data_store_->SetDeviceToken("", true); | 164 data_store_->SetDeviceToken("", true); |
165 loop_.RunAllPending(); | 165 loop_.RunUntilIdle(); |
166 } | 166 } |
167 | 167 |
168 void VerifyTest(const std::string& homepage_location) { | 168 void VerifyTest(const std::string& homepage_location) { |
169 // Test conditions. | 169 // Test conditions. |
170 EXPECT_EQ(CloudPolicySubsystem::SUCCESS, cloud_policy_subsystem_->state()); | 170 EXPECT_EQ(CloudPolicySubsystem::SUCCESS, cloud_policy_subsystem_->state()); |
171 StringValue homepage_value(homepage_location); | 171 StringValue homepage_value(homepage_location); |
172 VerifyPolicy(key::kHomepageLocation, &homepage_value); | 172 VerifyPolicy(key::kHomepageLocation, &homepage_value); |
173 VerifyServerLoad(); | 173 VerifyServerLoad(); |
174 } | 174 } |
175 | 175 |
(...skipping 284 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 |