Index: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp |
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp |
index ff81557e42cdc4de5d0bc6b1db5152c6af55c88e..0d13f195d720cc210e194a71f8927b1815b017aa 100644 |
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp |
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp |
@@ -104,7 +104,6 @@ |
void TearDown() override |
{ |
m_page.reset(); |
- CompositorWorkerThread::terminateExecution(); |
CompositorWorkerThread::clearSharedBackingThread(); |
} |
@@ -140,7 +139,6 @@ |
private: |
void executeScriptInWorker(WorkerThread* worker, WaitableEvent* waitEvent) |
{ |
- EXPECT_GT(worker->workerBackingThread().workerScriptCount(), 0u); |
WorkerOrWorkletScriptController* scriptController = worker->workerGlobalScope()->scriptController(); |
bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var counter = 0; ++counter;")); |
ASSERT_UNUSED(evaluateResult, evaluateResult); |
@@ -172,7 +170,9 @@ |
// Create the second worker and immediately destroy the first worker. |
OwnPtr<CompositorWorkerThread> secondWorker = createCompositorWorker(); |
- firstWorker->terminateAndWait(); |
+ // We don't use terminateAndWait here to avoid forcible termination. |
+ firstWorker->terminate(); |
+ firstWorker->waitForShutdownForTesting(); |
// Wait until the second worker is initialized. Verify that the second worker is using the same |
// thread and Isolate as the first worker. |
@@ -194,21 +194,18 @@ |
{ |
// Create the first worker, wait until it is initialized, and terminate it. |
OwnPtr<CompositorWorkerThread> compositorWorker = createCompositorWorker(); |
- WorkerBackingThread* workerBackingThread = &compositorWorker->workerBackingThread(); |
WebThreadSupportingGC* firstThread = &compositorWorker->workerBackingThread().backingThread(); |
checkWorkerCanExecuteScript(compositorWorker.get()); |
- ASSERT_EQ(2u, workerBackingThread->workerScriptCount()); |
- compositorWorker->terminateAndWait(); |
- |
- ASSERT_EQ(1u, workerBackingThread->workerScriptCount()); |
+ // We don't use terminateAndWait here to avoid forcible termination. |
+ compositorWorker->terminate(); |
+ compositorWorker->waitForShutdownForTesting(); |
// Create the second worker. The backing thread is same. |
compositorWorker = createCompositorWorker(); |
WebThreadSupportingGC* secondThread = &compositorWorker->workerBackingThread().backingThread(); |
EXPECT_EQ(firstThread, secondThread); |
checkWorkerCanExecuteScript(compositorWorker.get()); |
- ASSERT_EQ(2u, workerBackingThread->workerScriptCount()); |
compositorWorker->terminateAndWait(); |
} |
@@ -223,7 +220,6 @@ |
// Request termination of the first worker and create the second worker |
// as soon as possible. |
- EXPECT_EQ(2u, firstWorker->workerBackingThread().workerScriptCount()); |
firstWorker->terminate(); |
// We don't wait for its termination. |
// Note: We rely on the assumption that the termination steps don't run |