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 "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/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 const int64 kPolicyRefreshRate = 4 * 60 * 60 * 1000; | 31 const int64 kPolicyRefreshRate = 4 * 60 * 60 * 1000; |
32 | 32 |
33 class TestTaskRunner : public base::TaskRunner { | 33 class TestTaskRunner : public base::TaskRunner { |
34 public: | 34 public: |
35 TestTaskRunner() {} | 35 TestTaskRunner() {} |
36 | 36 |
37 virtual bool RunsTasksOnCurrentThread() const OVERRIDE { return true; } | 37 virtual bool RunsTasksOnCurrentThread() const OVERRIDE { return true; } |
| 38 virtual bool PostDelayedTask(const tracked_objects::Location&, |
| 39 const base::Closure&, |
| 40 int64) OVERRIDE { |
| 41 ADD_FAILURE(); |
| 42 return false; |
| 43 } |
38 MOCK_METHOD3(PostDelayedTask, bool(const tracked_objects::Location&, | 44 MOCK_METHOD3(PostDelayedTask, bool(const tracked_objects::Location&, |
39 const base::Closure&, | 45 const base::Closure&, |
40 base::TimeDelta)); | 46 base::TimeDelta)); |
41 | 47 |
42 protected: | 48 protected: |
43 virtual ~TestTaskRunner() {} | 49 virtual ~TestTaskRunner() {} |
44 | 50 |
45 private: | 51 private: |
46 DISALLOW_COPY_AND_ASSIGN(TestTaskRunner); | 52 DISALLOW_COPY_AND_ASSIGN(TestTaskRunner); |
47 }; | 53 }; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } while (GetParam().backoff_factor > 1 && | 280 } while (GetParam().backoff_factor > 1 && |
275 expected_delay_ms <= kPolicyRefreshRate); | 281 expected_delay_ms <= kPolicyRefreshRate); |
276 } | 282 } |
277 } | 283 } |
278 | 284 |
279 INSTANTIATE_TEST_CASE_P(CloudPolicyRefreshSchedulerClientErrorTest, | 285 INSTANTIATE_TEST_CASE_P(CloudPolicyRefreshSchedulerClientErrorTest, |
280 CloudPolicyRefreshSchedulerClientErrorTest, | 286 CloudPolicyRefreshSchedulerClientErrorTest, |
281 testing::ValuesIn(kClientErrorTestCases)); | 287 testing::ValuesIn(kClientErrorTestCases)); |
282 | 288 |
283 } // namespace policy | 289 } // namespace policy |
OLD | NEW |