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

Unified Diff: third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: rebase Created 3 years, 8 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/core/workers/ThreadedWorkletTest.cpp
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp b/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp
index ee203e3b7a4babf6944480a969d9b5a3b3d260df..1af1b19532b69994c6ec238e6ab4c6bc05542b19 100644
--- a/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp
+++ b/third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp
@@ -8,6 +8,7 @@
#include "core/workers/ThreadedWorkletMessagingProxy.h"
#include "core/workers/ThreadedWorkletObjectProxy.h"
#include "core/workers/WorkerInspectorProxy.h"
+#include "core/workers/WorkerTaskRunners.h"
#include "core/workers/WorkerThread.h"
#include "core/workers/WorkerThreadStartupData.h"
#include "core/workers/WorkerThreadTestHelper.h"
@@ -173,10 +174,13 @@ TEST_F(ThreadedWorkletTest, UseCounter) {
// API use on the DedicatedWorkerGlobalScope should be recorded in UseCounter
// on the Document.
EXPECT_FALSE(UseCounter::IsCounted(GetDocument(), kFeature1));
- GetWorkerThread()->PostTask(
- BLINK_FROM_HERE,
- CrossThreadBind(&ThreadedWorkletThreadForTest::CountFeature,
- CrossThreadUnretained(GetWorkerThread()), kFeature1));
+ GetWorkerThread()
+ ->GetWorkerTaskRunners()
+ ->Get(TaskType::kUnspecedTimer)
+ ->PostTask(
+ BLINK_FROM_HERE,
+ CrossThreadBind(&ThreadedWorkletThreadForTest::CountFeature,
+ CrossThreadUnretained(GetWorkerThread()), kFeature1));
testing::EnterRunLoop();
EXPECT_TRUE(UseCounter::IsCounted(GetDocument(), kFeature1));
@@ -187,10 +191,13 @@ TEST_F(ThreadedWorkletTest, UseCounter) {
// Deprecated API use on the ThreadedWorkletGlobalScope should be recorded in
// UseCounter on the Document.
EXPECT_FALSE(UseCounter::IsCounted(GetDocument(), kFeature2));
- GetWorkerThread()->PostTask(
- BLINK_FROM_HERE,
- CrossThreadBind(&ThreadedWorkletThreadForTest::CountDeprecation,
- CrossThreadUnretained(GetWorkerThread()), kFeature2));
+ GetWorkerThread()
+ ->GetWorkerTaskRunners()
+ ->Get(TaskType::kUnspecedTimer)
+ ->PostTask(
+ BLINK_FROM_HERE,
+ CrossThreadBind(&ThreadedWorkletThreadForTest::CountDeprecation,
+ CrossThreadUnretained(GetWorkerThread()), kFeature2));
testing::EnterRunLoop();
EXPECT_TRUE(UseCounter::IsCounted(GetDocument(), kFeature2));
}

Powered by Google App Engine
This is Rietveld 408576698