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

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: remove AbstractGlobalScope. 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 "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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 181 }
182 182
183 bool hasIsolate() const 183 bool hasIsolate() const
184 { 184 {
185 return CompositorWorkerThread::hasIsolateForTest(); 185 return CompositorWorkerThread::hasIsolateForTest();
186 } 186 }
187 187
188 private: 188 private:
189 void executeScriptInWorker(WorkerThread* worker, WebWaitableEvent* waitEvent ) 189 void executeScriptInWorker(WorkerThread* worker, WebWaitableEvent* waitEvent )
190 { 190 {
191 WorkerScriptController* scriptController = worker->workerGlobalScope()-> script(); 191 GlobalScopeScriptController* scriptController = worker->workerGlobalScop e()->script();
kinuko 2015/12/24 04:45:51 ditto, this could be kept as WorkerScriptControlle
192 bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var c ounter = 0; ++counter;")); 192 bool evaluateResult = scriptController->evaluate(ScriptSourceCode("var c ounter = 0; ++counter;"));
193 ASSERT_UNUSED(evaluateResult, evaluateResult); 193 ASSERT_UNUSED(evaluateResult, evaluateResult);
194 waitEvent->signal(); 194 waitEvent->signal();
195 } 195 }
196 196
197 OwnPtr<DummyPageHolder> m_page; 197 OwnPtr<DummyPageHolder> m_page;
198 RefPtr<SecurityOrigin> m_securityOrigin; 198 RefPtr<SecurityOrigin> m_securityOrigin;
199 OwnPtr<WorkerObjectProxy> m_objectProxy; 199 OwnPtr<WorkerObjectProxy> m_objectProxy;
200 CompositorWorkerTestPlatform m_testPlatform; 200 CompositorWorkerTestPlatform m_testPlatform;
201 }; 201 };
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 v8::Isolate* secondIsolate = secondWorker->isolate(); 298 v8::Isolate* secondIsolate = secondWorker->isolate();
299 ASSERT(secondIsolate); 299 ASSERT(secondIsolate);
300 EXPECT_EQ(firstIsolate, secondIsolate); 300 EXPECT_EQ(firstIsolate, secondIsolate);
301 301
302 // Verify that the isolate can run some scripts correctly in the second work er. 302 // Verify that the isolate can run some scripts correctly in the second work er.
303 checkWorkerCanExecuteScript(secondWorker.get()); 303 checkWorkerCanExecuteScript(secondWorker.get());
304 secondWorker->terminateAndWait(); 304 secondWorker->terminateAndWait();
305 } 305 }
306 306
307 } // namespace blink 307 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698