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

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

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: remove unnecessary comments 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/DedicatedWorkerTest.cpp
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp b/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp
index dc73e4b01257ae0c57e53b109f8b20cdab743dfb..4842fbce89be2cfbdfbe6d21a0d3fd71793a3dd9 100644
--- a/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp
+++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+#include "core/dom/TaskRunnerHelper.h"
#include "core/events/MessageEvent.h"
#include "core/inspector/ConsoleMessageStorage.h"
#include "core/testing/DummyPageHolder.h"
@@ -17,7 +19,6 @@
#include "platform/testing/UnitTestHelpers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include <memory>
namespace blink {
@@ -388,10 +389,11 @@ TEST_F(DedicatedWorkerTest, 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(&DedicatedWorkerThreadForTest::CountFeature,
- CrossThreadUnretained(GetWorkerThread()), kFeature1));
+ TaskRunnerHelper::Get(TaskType::kUnspecedTimer, GetWorkerThread())
+ ->PostTask(
+ BLINK_FROM_HERE,
+ CrossThreadBind(&DedicatedWorkerThreadForTest::CountFeature,
+ CrossThreadUnretained(GetWorkerThread()), kFeature1));
testing::EnterRunLoop();
EXPECT_TRUE(UseCounter::IsCounted(GetDocument(), kFeature1));
@@ -402,10 +404,11 @@ TEST_F(DedicatedWorkerTest, UseCounter) {
// Deprecated API use on the DedicatedWorkerGlobalScope should be recorded in
// UseCounter on the Document.
EXPECT_FALSE(UseCounter::IsCounted(GetDocument(), kFeature2));
- GetWorkerThread()->PostTask(
- BLINK_FROM_HERE,
- CrossThreadBind(&DedicatedWorkerThreadForTest::CountDeprecation,
- CrossThreadUnretained(GetWorkerThread()), kFeature2));
+ TaskRunnerHelper::Get(TaskType::kUnspecedTimer, GetWorkerThread())
+ ->PostTask(
+ BLINK_FROM_HERE,
+ CrossThreadBind(&DedicatedWorkerThreadForTest::CountDeprecation,
+ CrossThreadUnretained(GetWorkerThread()), kFeature2));
testing::EnterRunLoop();
EXPECT_TRUE(UseCounter::IsCounted(GetDocument(), kFeature2));
}

Powered by Google App Engine
This is Rietveld 408576698