OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "platform/Timer.h" | 5 #include "platform/Timer.h" |
6 | 6 |
7 #include "platform/testing/TestingPlatformSupport.h" | 7 #include "platform/testing/TestingPlatformSupport.h" |
8 #include "public/platform/Platform.h" | 8 #include "public/platform/Platform.h" |
9 #include "public/platform/WebScheduler.h" | 9 #include "public/platform/WebScheduler.h" |
10 #include "public/platform/WebThread.h" | 10 #include "public/platform/WebThread.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 { | 98 { |
99 ASSERT_NOT_REACHED(); | 99 ASSERT_NOT_REACHED(); |
100 return 0.0; | 100 return 0.0; |
101 } | 101 } |
102 | 102 |
103 double monotonicallyIncreasingVirtualTimeSeconds() const override | 103 double monotonicallyIncreasingVirtualTimeSeconds() const override |
104 { | 104 { |
105 return gCurrentTimeSecs; | 105 return gCurrentTimeSecs; |
106 } | 106 } |
107 | 107 |
| 108 scoped_refptr<base::SingleThreadTaskRunner> taskRunner() override |
| 109 { |
| 110 ASSERT_NOT_REACHED(); |
| 111 return nullptr; |
| 112 } |
| 113 |
108 std::priority_queue<DelayedTask>* m_timerTasks; // NOT OWNED | 114 std::priority_queue<DelayedTask>* m_timerTasks; // NOT OWNED |
109 }; | 115 }; |
110 | 116 |
111 class MockWebScheduler : public WebScheduler { | 117 class MockWebScheduler : public WebScheduler { |
112 public: | 118 public: |
113 MockWebScheduler() : m_timerWebTaskRunner(&m_timerTasks) { } | 119 MockWebScheduler() : m_timerWebTaskRunner(&m_timerTasks) { } |
114 ~MockWebScheduler() override { } | 120 ~MockWebScheduler() override { } |
115 | 121 |
116 bool shouldYieldForHighPriorityWork() override | 122 bool shouldYieldForHighPriorityWork() override |
117 { | 123 { |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner); | 784 TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner); |
779 timer.startOneShot(0, BLINK_FROM_HERE); | 785 timer.startOneShot(0, BLINK_FROM_HERE); |
780 | 786 |
781 // Make sure the task was posted on taskRunner. | 787 // Make sure the task was posted on taskRunner. |
782 EXPECT_FALSE(timerTasks.empty()); | 788 EXPECT_FALSE(timerTasks.empty()); |
783 } | 789 } |
784 | 790 |
785 | 791 |
786 } // namespace | 792 } // namespace |
787 } // namespace blink | 793 } // namespace blink |
OLD | NEW |