| 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 7bb1f8990762e426df7004d2c12637105c542941..52c036160c15823de117f63d29e25fc3a1c5b0ec 100644
|
| --- a/components/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
|
| +++ b/components/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
|
| @@ -8,6 +8,7 @@
|
| #include "components/scheduler/child/worker_scheduler_impl.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| +#include "third_party/WebKit/public/platform/WebScheduler.h"
|
| #include "third_party/WebKit/public/platform/WebTraceLocation.h"
|
|
|
| using testing::_;
|
| @@ -132,6 +133,23 @@ TEST_F(WebThreadImplForWorkerSchedulerTest,
|
|
|
| thread_->postTask(blink::WebTraceLocation(), task.release());
|
| thread_.reset();
|
| + completion.Wait();
|
| +}
|
| +
|
| +TEST_F(WebThreadImplForWorkerSchedulerTest,
|
| + TestThreadShutdownAfterPreShutdown) {
|
| + scoped_ptr<MockTask> task(new MockTask());
|
| + base::WaitableEvent completion(false, false);
|
| +
|
| + ON_CALL(*task, run())
|
| + .WillByDefault(Invoke([&completion]() { completion.Signal(); }));
|
| +
|
| + // preShutdown should block the postTask, but not the internal shutdown task.
|
| + thread_->scheduler()->preShutdown();
|
| + thread_->postTask(blink::WebTraceLocation(), task.release());
|
| + thread_.reset();
|
| +
|
| + EXPECT_FALSE(completion.IsSignaled());
|
| }
|
|
|
| TEST_F(WebThreadImplForWorkerSchedulerTest, TestIdleTask) {
|
|
|