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

Side by Side Diff: third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp

Issue 2633293003: Remove TestingPlatformMockScheduler (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "wtf/CurrentTime.h" 10 #include "wtf/CurrentTime.h"
11 11
12 namespace blink { 12 namespace blink {
13 namespace { 13 namespace {
14 14
15 class MockScheduler final : public TestingPlatformMockScheduler { 15 class MockScheduler final : public WebScheduler {
16 public: 16 public:
17 MockScheduler() {} 17 MockScheduler() {}
18 ~MockScheduler() override {} 18 ~MockScheduler() override {}
19
20 // WebScheduler implementation:
21 WebTaskRunner* loadingTaskRunner() override { return nullptr; }
22 WebTaskRunner* timerTaskRunner() override { return nullptr; }
23 void shutdown() override {}
19 bool shouldYieldForHighPriorityWork() override { return true; } 24 bool shouldYieldForHighPriorityWork() override { return true; }
25 bool canExceedIdleDeadlineIfRequired() override { return false; }
26 void postIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override {}
27 void postNonNestableIdleTask(const WebTraceLocation&,
28 WebThread::IdleTask*) override {}
29 std::unique_ptr<WebViewScheduler> createWebViewScheduler(
30 InterventionReporter*,
31 WebViewScheduler::WebViewSchedulerSettings*) override {
32 return nullptr;
33 }
34 void suspendTimerQueue() override {}
35 void resumeTimerQueue() override {}
36 void addPendingNavigation(WebScheduler::NavigatingFrameType) override {}
37 void removePendingNavigation(WebScheduler::NavigatingFrameType) override {}
20 38
21 private: 39 private:
22 DISALLOW_COPY_AND_ASSIGN(MockScheduler); 40 DISALLOW_COPY_AND_ASSIGN(MockScheduler);
23 }; 41 };
24 42
25 class MockThread final : public WebThread { 43 class MockThread final : public WebThread {
26 public: 44 public:
27 MockThread() {} 45 MockThread() {}
28 ~MockThread() override {} 46 ~MockThread() override {}
29 bool isCurrentThread() const override { return true; } 47 bool isCurrentThread() const override { return true; }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 94
77 TEST_F(IdleDeadlineTest, yieldForHighPriorityWork) { 95 TEST_F(IdleDeadlineTest, yieldForHighPriorityWork) {
78 ScopedTestingPlatformSupport<MockPlatform> platform; 96 ScopedTestingPlatformSupport<MockPlatform> platform;
79 97
80 IdleDeadline* deadline = 98 IdleDeadline* deadline =
81 IdleDeadline::create(1.25, IdleDeadline::CallbackType::CalledWhenIdle); 99 IdleDeadline::create(1.25, IdleDeadline::CallbackType::CalledWhenIdle);
82 EXPECT_FLOAT_EQ(0, deadline->timeRemaining()); 100 EXPECT_FLOAT_EQ(0, deadline->timeRemaining());
83 } 101 }
84 102
85 } // namespace blink 103 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698