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

Side by Side Diff: chrome/browser/policy/cloud_policy_refresh_scheduler_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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/policy/cloud_policy_refresh_scheduler.h" 10 #include "chrome/browser/policy/cloud_policy_refresh_scheduler.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 CloudPolicyRefreshScheduler* CreateRefreshScheduler() { 63 CloudPolicyRefreshScheduler* CreateRefreshScheduler() {
64 return new CloudPolicyRefreshScheduler(&client_, &store_, &prefs_, 64 return new CloudPolicyRefreshScheduler(&client_, &store_, &prefs_,
65 prefs::kUserPolicyRefreshRate, 65 prefs::kUserPolicyRefreshRate,
66 task_runner_); 66 task_runner_);
67 } 67 }
68 68
69 void NotifyIPAddressChanged() { 69 void NotifyIPAddressChanged() {
70 net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); 70 net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
71 loop_.RunAllPending(); 71 loop_.RunUntilIdle();
72 } 72 }
73 73
74 void CheckTiming(int64 expected_delay_ms) { 74 void CheckTiming(int64 expected_delay_ms) {
75 base::Time now(base::Time::NowFromSystemTime()); 75 base::Time now(base::Time::NowFromSystemTime());
76 base::TimeDelta expected_delay( 76 base::TimeDelta expected_delay(
77 base::TimeDelta::FromMilliseconds(expected_delay_ms)); 77 base::TimeDelta::FromMilliseconds(expected_delay_ms));
78 EXPECT_GE(last_delay_, expected_delay - (now - last_refresh_)); 78 EXPECT_GE(last_delay_, expected_delay - (now - last_refresh_));
79 EXPECT_LE(last_delay_, expected_delay); 79 EXPECT_LE(last_delay_, expected_delay);
80 } 80 }
81 81
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 EXPECT_EQ(base::TimeDelta(), last_delay_); 271 EXPECT_EQ(base::TimeDelta(), last_delay_);
272 EXPECT_TRUE(last_callback_.is_null()); 272 EXPECT_TRUE(last_callback_.is_null());
273 } 273 }
274 } 274 }
275 275
276 INSTANTIATE_TEST_CASE_P(CloudPolicyRefreshSchedulerClientErrorTest, 276 INSTANTIATE_TEST_CASE_P(CloudPolicyRefreshSchedulerClientErrorTest,
277 CloudPolicyRefreshSchedulerClientErrorTest, 277 CloudPolicyRefreshSchedulerClientErrorTest,
278 testing::ValuesIn(kClientErrorTestCases)); 278 testing::ValuesIn(kClientErrorTestCases));
279 279
280 } // namespace policy 280 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud_policy_controller_unittest.cc ('k') | chrome/browser/policy/cloud_policy_subsystem_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698