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

Side by Side Diff: chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 "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 "base/test/test_simple_task_runner.h" 10 #include "base/test/test_simple_task_runner.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 void CheckTiming(int64 expected_delay_ms) const { 74 void CheckTiming(int64 expected_delay_ms) const {
75 EXPECT_FALSE(task_runner_->GetPendingTasks().empty()); 75 EXPECT_FALSE(task_runner_->GetPendingTasks().empty());
76 base::Time now(base::Time::NowFromSystemTime()); 76 base::Time now(base::Time::NowFromSystemTime());
77 base::TimeDelta expected_delay( 77 base::TimeDelta expected_delay(
78 base::TimeDelta::FromMilliseconds(expected_delay_ms)); 78 base::TimeDelta::FromMilliseconds(expected_delay_ms));
79 EXPECT_GE(GetLastDelay(), expected_delay - (now - last_refresh_)); 79 EXPECT_GE(GetLastDelay(), expected_delay - (now - last_refresh_));
80 EXPECT_LE(GetLastDelay(), expected_delay); 80 EXPECT_LE(GetLastDelay(), expected_delay);
81 } 81 }
82 82
83 MessageLoop loop_; 83 base::MessageLoop loop_;
84 MockCloudPolicyClient client_; 84 MockCloudPolicyClient client_;
85 MockCloudPolicyStore store_; 85 MockCloudPolicyStore store_;
86 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; 86 scoped_refptr<base::TestSimpleTaskRunner> task_runner_;
87 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; 87 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
88 88
89 // Base time for the refresh that the scheduler should be using. 89 // Base time for the refresh that the scheduler should be using.
90 base::Time last_refresh_; 90 base::Time last_refresh_;
91 }; 91 };
92 92
93 TEST_F(CloudPolicyRefreshSchedulerTest, InitialRefreshNoPolicy) { 93 TEST_F(CloudPolicyRefreshSchedulerTest, InitialRefreshNoPolicy) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 EXPECT_EQ(base::TimeDelta(), GetLastDelay()); 285 EXPECT_EQ(base::TimeDelta(), GetLastDelay());
286 EXPECT_TRUE(task_runner_->GetPendingTasks().empty()); 286 EXPECT_TRUE(task_runner_->GetPendingTasks().empty());
287 } 287 }
288 } 288 }
289 289
290 INSTANTIATE_TEST_CASE_P(CloudPolicyRefreshSchedulerClientErrorTest, 290 INSTANTIATE_TEST_CASE_P(CloudPolicyRefreshSchedulerClientErrorTest,
291 CloudPolicyRefreshSchedulerClientErrorTest, 291 CloudPolicyRefreshSchedulerClientErrorTest,
292 testing::ValuesIn(kClientErrorTestCases)); 292 testing::ValuesIn(kClientErrorTestCases));
293 293
294 } // namespace policy 294 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud/cloud_policy_manager_unittest.cc ('k') | chrome/browser/policy/cloud/cloud_policy_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698