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 } | |
44 MOCK_METHOD3(PostDelayedTask, bool(const tracked_objects::Location&, | 38 MOCK_METHOD3(PostDelayedTask, bool(const tracked_objects::Location&, |
45 const base::Closure&, | 39 const base::Closure&, |
46 base::TimeDelta)); | 40 base::TimeDelta)); |
47 | 41 |
48 protected: | 42 protected: |
49 virtual ~TestTaskRunner() {} | 43 virtual ~TestTaskRunner() {} |
50 | 44 |
51 private: | 45 private: |
52 DISALLOW_COPY_AND_ASSIGN(TestTaskRunner); | 46 DISALLOW_COPY_AND_ASSIGN(TestTaskRunner); |
53 }; | 47 }; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 } while (GetParam().backoff_factor > 1 && | 274 } while (GetParam().backoff_factor > 1 && |
281 expected_delay_ms <= kPolicyRefreshRate); | 275 expected_delay_ms <= kPolicyRefreshRate); |
282 } | 276 } |
283 } | 277 } |
284 | 278 |
285 INSTANTIATE_TEST_CASE_P(CloudPolicyRefreshSchedulerClientErrorTest, | 279 INSTANTIATE_TEST_CASE_P(CloudPolicyRefreshSchedulerClientErrorTest, |
286 CloudPolicyRefreshSchedulerClientErrorTest, | 280 CloudPolicyRefreshSchedulerClientErrorTest, |
287 testing::ValuesIn(kClientErrorTestCases)); | 281 testing::ValuesIn(kClientErrorTestCases)); |
288 | 282 |
289 } // namespace policy | 283 } // namespace policy |
OLD | NEW |