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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp

Issue 1955693003: compositor-worker: Keep worker backing thread alive for the lifetime of the compositor thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the constructed WorkerBackingThread to post tasks. Created 4 years, 7 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 | « third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fec898363838d730d6e890f74d44c5b538007292..98528e1e05e33adcaf804dccc7bd20f292e5f340 100644
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
@@ -94,7 +94,7 @@ class CompositorWorkerThreadTest : public ::testing::Test {
public:
void SetUp() override
{
- CompositorWorkerThread::resetSharedBackingThreadForTest();
+ CompositorWorkerThread::createSharedBackingThreadForTest();
m_page = DummyPageHolder::create();
m_objectProxy = TestCompositorWorkerObjectProxy::create(&m_page->document());
m_securityOrigin = SecurityOrigin::create(KURL(ParsedURLString, "http://fake.url/"));
@@ -103,7 +103,8 @@ public:
void TearDown() override
{
m_page.reset();
- CompositorWorkerThread::resetSharedBackingThreadForTest();
+ CompositorWorkerThread::terminateExecution();
+ CompositorWorkerThread::clearSharedBackingThread();
}
PassOwnPtr<CompositorWorkerThread> createCompositorWorker()
@@ -196,17 +197,17 @@ TEST_F(CompositorWorkerThreadTest, TerminateFirstAndCreateSecond)
WebThreadSupportingGC* firstThread = &compositorWorker->workerBackingThread().backingThread();
checkWorkerCanExecuteScript(compositorWorker.get());
- ASSERT_EQ(1u, workerBackingThread->workerScriptCount());
+ ASSERT_EQ(2u, workerBackingThread->workerScriptCount());
compositorWorker->terminateAndWait();
- ASSERT_EQ(0u, workerBackingThread->workerScriptCount());
+ ASSERT_EQ(1u, workerBackingThread->workerScriptCount());
// 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(1u, workerBackingThread->workerScriptCount());
+ ASSERT_EQ(2u, workerBackingThread->workerScriptCount());
compositorWorker->terminateAndWait();
}
@@ -221,7 +222,7 @@ TEST_F(CompositorWorkerThreadTest, CreatingSecondDuringTerminationOfFirst)
// Request termination of the first worker and create the second worker
// as soon as possible.
- EXPECT_EQ(1u, firstWorker->workerBackingThread().workerScriptCount());
+ 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
« no previous file with comments | « third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698