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

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

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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

Powered by Google App Engine
This is Rietveld 408576698