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

Side by Side Diff: third_party/WebKit/Source/platform/TimerTest.cpp

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another GYP fix Created 4 years, 5 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698