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

Unified Diff: components/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc

Issue 1308183005: Introduce WebTaskRunner Patch 2/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final tweaks Created 5 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: components/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
diff --git a/components/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc b/components/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
index 40013a11d1a94f589377191a1d5c34b92f9fe5da..db4fd18726ed71e31877fd64aaff037b9ceb77b3 100644
--- a/components/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
+++ b/components/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
@@ -19,14 +19,14 @@ using testing::Invoke;
namespace scheduler {
namespace {
-class NopTask : public blink::WebThread::Task {
+class NopTask : public blink::WebTaskRunner::Task {
public:
~NopTask() override {}
void run() {}
};
-class MockTask : public blink::WebThread::Task {
+class MockTask : public blink::WebTaskRunner::Task {
public:
~MockTask() override {}
@@ -54,7 +54,7 @@ class TestObserver : public blink::WebThread::TaskObserver {
std::string* calls_; // NOT OWNED
};
-class TestTask : public blink::WebThread::Task {
+class TestTask : public blink::WebTaskRunner::Task {
public:
explicit TestTask(std::string* calls) : calls_(calls) {}
@@ -124,7 +124,7 @@ TEST_F(WebThreadImplForWorkerSchedulerTest, TestDefaultTask) {
ON_CALL(*task, run())
.WillByDefault(Invoke([&completion]() { completion.Signal(); }));
- thread_->postTask(blink::WebTraceLocation(), task.release());
+ thread_->taskRunner()->postTask(blink::WebTraceLocation(), task.release());
completion.Wait();
}
@@ -137,7 +137,7 @@ TEST_F(WebThreadImplForWorkerSchedulerTest,
ON_CALL(*task, run())
.WillByDefault(Invoke([&completion]() { completion.Signal(); }));
- thread_->postTask(blink::WebTraceLocation(), task.release());
+ thread_->taskRunner()->postTask(blink::WebTraceLocation(), task.release());
thread_.reset();
}
@@ -151,7 +151,8 @@ TEST_F(WebThreadImplForWorkerSchedulerTest, TestIdleTask) {
thread_->postIdleTask(blink::WebTraceLocation(), task.release());
// We need to post a wakeup task or idle work will never happen.
- thread_->postDelayedTask(blink::WebTraceLocation(), new NopTask(), 50ul);
+ thread_->taskRunner()->postDelayedTask(blink::WebTraceLocation(),
+ new NopTask(), 50ll);
completion.Wait();
}
@@ -162,7 +163,8 @@ TEST_F(WebThreadImplForWorkerSchedulerTest, TestTaskObserver) {
RunOnWorkerThread(FROM_HERE,
base::Bind(&addTaskObserver, thread_.get(), &observer));
- thread_->postTask(blink::WebTraceLocation(), new TestTask(&calls));
+ thread_->taskRunner()->postTask(blink::WebTraceLocation(),
+ new TestTask(&calls));
RunOnWorkerThread(FROM_HERE,
base::Bind(&removeTaskObserver, thread_.get(), &observer));
@@ -182,8 +184,9 @@ TEST_F(WebThreadImplForWorkerSchedulerTest, TestShutdown) {
EXPECT_CALL(*delayed_task, run()).Times(0);
RunOnWorkerThread(FROM_HERE, base::Bind(&shutdownOnThread, thread_.get()));
- thread_->postTask(blink::WebTraceLocation(), task.release());
- thread_->postDelayedTask(blink::WebTraceLocation(), task.release(), 50ul);
+ thread_->taskRunner()->postTask(blink::WebTraceLocation(), task.release());
+ thread_->taskRunner()->postDelayedTask(blink::WebTraceLocation(),
+ task.release(), 50ll);
thread_.reset();
}

Powered by Google App Engine
This is Rietveld 408576698