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

Unified Diff: third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h

Issue 2276353002: Remove after wakeup logic and replace PumpTask with Fences (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Slight simplification Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h
index 78a32bf75162f75254b0e19635292ce72bf466ad..0afbea8ff31ec040669f789ff34da42c575df849 100644
--- a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h
+++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h
@@ -65,6 +65,35 @@ class WebThread;
class TestingCompositorSupport : public WebCompositorSupport {
};
+class TestingPlatformMockScheduler : public WebScheduler {
+ WTF_MAKE_NONCOPYABLE(TestingPlatformMockScheduler);
+public:
+ TestingPlatformMockScheduler();
+ ~TestingPlatformMockScheduler() override;
+
+ void runSingleTask();
+ void runAllTasks();
+
+ // WebScheduler implementation:
+ WebTaskRunner* loadingTaskRunner() override;
+ WebTaskRunner* timerTaskRunner() override;
+ void shutdown() override {}
+ bool shouldYieldForHighPriorityWork() override { return false; }
+ bool canExceedIdleDeadlineIfRequired() override { return false; }
+ void postIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override { }
+ void postNonNestableIdleTask(const WebTraceLocation&, WebThread::IdleTask*) override { }
+ std::unique_ptr<WebViewScheduler> createWebViewScheduler(InterventionReporter*) override { return nullptr; }
+ void suspendTimerQueue() override { }
+ void resumeTimerQueue() override { }
+ void addPendingNavigation(WebScheduler::NavigatingFrameType) override { }
+ void removePendingNavigation(WebScheduler::NavigatingFrameType) override { }
+ void onNavigationStarted() override { }
+
+private:
+ WTF::Deque<std::unique_ptr<WebTaskRunner::Task>> m_tasks;
+ std::unique_ptr<TestingPlatformMockWebTaskRunner> m_mockWebTaskRunner;
+};
+
class TestingPlatformSupport : public Platform {
WTF_MAKE_NONCOPYABLE(TestingPlatformSupport);
public:

Powered by Google App Engine
This is Rietveld 408576698