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

Side by Side Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp

Issue 1535943005: Initial implementation of bindings and basic classes for worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix memory leak. Created 4 years, 12 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 "config.h" 5 #include "config.h"
6 #include "modules/compositorworker/CompositorWorkerThread.h" 6 #include "modules/compositorworker/CompositorWorkerThread.h"
7 7
8 #include "bindings/core/v8/ScriptSourceCode.h" 8 #include "bindings/core/v8/ScriptSourceCode.h"
9 #include "bindings/core/v8/V8GCController.h" 9 #include "bindings/core/v8/V8GCController.h"
10 #include "core/inspector/ConsoleMessage.h" 10 #include "core/inspector/ConsoleMessage.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 bool hasIsolate() const 184 bool hasIsolate() const
185 { 185 {
186 return CompositorWorkerThread::hasIsolateForTest(); 186 return CompositorWorkerThread::hasIsolateForTest();
187 } 187 }
188 188
189 private: 189 private:
190 void executeScriptInWorker(WorkerThread* worker, WebWaitableEvent* waitEvent ) 190 void executeScriptInWorker(WorkerThread* worker, WebWaitableEvent* waitEvent )
191 { 191 {
192 WorkerScriptController* scriptController = worker->workerGlobalScope()-> script(); 192 GlobalScopeScriptController* scriptController = worker->workerGlobalScop e()->script();
193 bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var c ounter = 0; ++counter;")); 193 bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var c ounter = 0; ++counter;"));
194 ASSERT_UNUSED(evaluateResult, evaluateResult); 194 ASSERT_UNUSED(evaluateResult, evaluateResult);
195 waitEvent->signal(); 195 waitEvent->signal();
196 } 196 }
197 197
198 OwnPtr<DummyPageHolder> m_page; 198 OwnPtr<DummyPageHolder> m_page;
199 RefPtr<SecurityOrigin> m_securityOrigin; 199 RefPtr<SecurityOrigin> m_securityOrigin;
200 OwnPtr<WorkerObjectProxy> m_objectProxy; 200 OwnPtr<WorkerObjectProxy> m_objectProxy;
201 CompositorWorkerTestPlatform m_testPlatform; 201 CompositorWorkerTestPlatform m_testPlatform;
202 }; 202 };
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 v8::Isolate* secondIsolate = secondWorker->isolate(); 299 v8::Isolate* secondIsolate = secondWorker->isolate();
300 ASSERT(secondIsolate); 300 ASSERT(secondIsolate);
301 EXPECT_EQ(firstIsolate, secondIsolate); 301 EXPECT_EQ(firstIsolate, secondIsolate);
302 302
303 // Verify that the isolate can run some scripts correctly in the second work er. 303 // Verify that the isolate can run some scripts correctly in the second work er.
304 checkWorkerCanExecuteScript(secondWorker.get()); 304 checkWorkerCanExecuteScript(secondWorker.get());
305 secondWorker->terminateAndWait(); 305 secondWorker->terminateAndWait();
306 } 306 }
307 307
308 } // namespace blink 308 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698