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

Unified Diff: test/unittests/libplatform/worker-thread-unittest.cc

Issue 2270703002: Add test for posting a single task to the worker pool (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: different approach Created 4 years, 4 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
« no previous file with comments | « src/libplatform/task-queue.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/libplatform/worker-thread-unittest.cc
diff --git a/test/unittests/libplatform/worker-thread-unittest.cc b/test/unittests/libplatform/worker-thread-unittest.cc
index 175b31166691cb75644eafb807973237ffd7c483..f0b41e78dd8c22ad88260c25c6184743bd18fba0 100644
--- a/test/unittests/libplatform/worker-thread-unittest.cc
+++ b/test/unittests/libplatform/worker-thread-unittest.cc
@@ -44,5 +44,21 @@ TEST(WorkerThreadTest, Basic) {
queue.Terminate();
}
+TEST(WorkerThreadTest, PostSingleTask) {
+ TaskQueue queue;
+ WorkerThread thread1(&queue);
+ WorkerThread thread2(&queue);
+
+ InSequence s;
+ StrictMock<MockTask>* task = new StrictMock<MockTask>;
+ EXPECT_CALL(*task, Run());
+ EXPECT_CALL(*task, Die());
+ queue.Append(task);
+
+ // The next call should not time out.
+ queue.BlockUntilQueueEmptyForTesting();
+ queue.Terminate();
+}
+
} // namespace platform
} // namespace v8
« no previous file with comments | « src/libplatform/task-queue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698