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 |