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

Side by Side 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: Expand on comments. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/compositorworker/CompositorWorkerThread.h" 5 #include "modules/compositorworker/CompositorWorkerThread.h"
6 6
7 #include "bindings/core/v8/ScriptSourceCode.h" 7 #include "bindings/core/v8/ScriptSourceCode.h"
8 #include "bindings/core/v8/V8GCController.h" 8 #include "bindings/core/v8/V8GCController.h"
9 #include "core/inspector/ConsoleMessage.h" 9 #include "core/inspector/ConsoleMessage.h"
10 #include "core/testing/DummyPageHolder.h" 10 #include "core/testing/DummyPageHolder.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 { 84 {
85 CompositorWorkerThread::resetSharedBackingThreadForTest(); 85 CompositorWorkerThread::resetSharedBackingThreadForTest();
86 m_page = DummyPageHolder::create(); 86 m_page = DummyPageHolder::create();
87 m_objectProxy = TestCompositorWorkerObjectProxy::create(&m_page->documen t()); 87 m_objectProxy = TestCompositorWorkerObjectProxy::create(&m_page->documen t());
88 m_securityOrigin = SecurityOrigin::create(KURL(ParsedURLString, "http:// fake.url/")); 88 m_securityOrigin = SecurityOrigin::create(KURL(ParsedURLString, "http:// fake.url/"));
89 } 89 }
90 90
91 void TearDown() override 91 void TearDown() override
92 { 92 {
93 m_page.clear(); 93 m_page.clear();
94 CompositorWorkerThread::resetSharedBackingThreadForTest(); 94 CompositorWorkerThread::clearSharedBackingThread();
yhirano 2016/05/11 02:21:02 I think the latter half of https://codereview.chro
flackr 2016/05/18 05:26:50 It is a bit fragile, though we normally don't re-u
95 } 95 }
96 96
97 PassOwnPtr<CompositorWorkerThread> createCompositorWorker() 97 PassOwnPtr<CompositorWorkerThread> createCompositorWorker()
98 { 98 {
99 OwnPtr<CompositorWorkerThread> workerThread = CompositorWorkerThread::cr eate(nullptr, *m_objectProxy, 0); 99 OwnPtr<CompositorWorkerThread> workerThread = CompositorWorkerThread::cr eate(nullptr, *m_objectProxy, 0);
100 WorkerClients* clients = nullptr; 100 WorkerClients* clients = nullptr;
101 workerThread->start(WorkerThreadStartupData::create( 101 workerThread->start(WorkerThreadStartupData::create(
102 KURL(ParsedURLString, "http://fake.url/"), 102 KURL(ParsedURLString, "http://fake.url/"),
103 "fake user agent", 103 "fake user agent",
104 "//fake source code", 104 "//fake source code",
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 v8::Isolate* secondIsolate = secondWorker->isolate(); 218 v8::Isolate* secondIsolate = secondWorker->isolate();
219 ASSERT_TRUE(secondIsolate); 219 ASSERT_TRUE(secondIsolate);
220 EXPECT_EQ(firstIsolate, secondIsolate); 220 EXPECT_EQ(firstIsolate, secondIsolate);
221 221
222 // Verify that the isolate can run some scripts correctly in the second work er. 222 // Verify that the isolate can run some scripts correctly in the second work er.
223 checkWorkerCanExecuteScript(secondWorker.get()); 223 checkWorkerCanExecuteScript(secondWorker.get());
224 secondWorker->terminateAndWait(); 224 secondWorker->terminateAndWait();
225 } 225 }
226 226
227 } // namespace blink 227 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698