OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/dom/IdleDeadline.h" | 5 #include "core/dom/IdleDeadline.h" |
6 | 6 |
7 #include "platform/testing/TestingPlatformSupport.h" | 7 #include "platform/testing/TestingPlatformSupport.h" |
8 #include "platform/wtf/CurrentTime.h" | 8 #include "platform/wtf/CurrentTime.h" |
9 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 bool ShouldYieldForHighPriorityWork() override { return true; } | 24 bool ShouldYieldForHighPriorityWork() override { return true; } |
25 bool CanExceedIdleDeadlineIfRequired() override { return false; } | 25 bool CanExceedIdleDeadlineIfRequired() override { return false; } |
26 void PostIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override {} | 26 void PostIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override {} |
27 void PostNonNestableIdleTask(const WebTraceLocation&, | 27 void PostNonNestableIdleTask(const WebTraceLocation&, |
28 WebThread::IdleTask*) override {} | 28 WebThread::IdleTask*) override {} |
29 std::unique_ptr<WebViewScheduler> CreateWebViewScheduler( | 29 std::unique_ptr<WebViewScheduler> CreateWebViewScheduler( |
30 InterventionReporter*, | 30 InterventionReporter*, |
31 WebViewScheduler::WebViewSchedulerSettings*) override { | 31 WebViewScheduler::WebViewSchedulerSettings*) override { |
32 return nullptr; | 32 return nullptr; |
33 } | 33 } |
| 34 WebTaskRunner* CompositorTaskRunner() override { return nullptr; } |
34 void SuspendTimerQueue() override {} | 35 void SuspendTimerQueue() override {} |
35 void ResumeTimerQueue() override {} | 36 void ResumeTimerQueue() override {} |
36 void AddPendingNavigation( | 37 void AddPendingNavigation( |
37 scheduler::RendererScheduler::NavigatingFrameType) override {} | 38 scheduler::RendererScheduler::NavigatingFrameType) override {} |
38 void RemovePendingNavigation( | 39 void RemovePendingNavigation( |
39 scheduler::RendererScheduler::NavigatingFrameType) override {} | 40 scheduler::RendererScheduler::NavigatingFrameType) override {} |
40 | 41 |
41 private: | 42 private: |
42 DISALLOW_COPY_AND_ASSIGN(MockScheduler); | 43 DISALLOW_COPY_AND_ASSIGN(MockScheduler); |
43 }; | 44 }; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 97 |
97 TEST_F(IdleDeadlineTest, yieldForHighPriorityWork) { | 98 TEST_F(IdleDeadlineTest, yieldForHighPriorityWork) { |
98 ScopedTestingPlatformSupport<MockPlatform> platform; | 99 ScopedTestingPlatformSupport<MockPlatform> platform; |
99 | 100 |
100 IdleDeadline* deadline = | 101 IdleDeadline* deadline = |
101 IdleDeadline::Create(1.25, IdleDeadline::CallbackType::kCalledWhenIdle); | 102 IdleDeadline::Create(1.25, IdleDeadline::CallbackType::kCalledWhenIdle); |
102 EXPECT_FLOAT_EQ(0, deadline->timeRemaining()); | 103 EXPECT_FLOAT_EQ(0, deadline->timeRemaining()); |
103 } | 104 } |
104 | 105 |
105 } // namespace blink | 106 } // namespace blink |
OLD | NEW |