OLD | NEW |
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/SourceLocation.h" |
8 #include "bindings/core/v8/V8GCController.h" | 9 #include "bindings/core/v8/V8GCController.h" |
9 #include "core/inspector/ConsoleMessage.h" | 10 #include "core/inspector/ConsoleMessage.h" |
10 #include "core/testing/DummyPageHolder.h" | 11 #include "core/testing/DummyPageHolder.h" |
11 #include "core/workers/InProcessWorkerObjectProxy.h" | 12 #include "core/workers/InProcessWorkerObjectProxy.h" |
12 #include "core/workers/WorkerBackingThread.h" | 13 #include "core/workers/WorkerBackingThread.h" |
13 #include "core/workers/WorkerLoaderProxy.h" | 14 #include "core/workers/WorkerLoaderProxy.h" |
14 #include "core/workers/WorkerThreadStartupData.h" | 15 #include "core/workers/WorkerThreadStartupData.h" |
15 #include "platform/ThreadSafeFunctional.h" | 16 #include "platform/ThreadSafeFunctional.h" |
16 #include "platform/WaitableEvent.h" | 17 #include "platform/WaitableEvent.h" |
17 #include "platform/WebThreadSupportingGC.h" | 18 #include "platform/WebThreadSupportingGC.h" |
18 #include "platform/heap/Handle.h" | 19 #include "platform/heap/Handle.h" |
19 #include "platform/testing/TestingPlatformSupport.h" | 20 #include "platform/testing/TestingPlatformSupport.h" |
20 #include "platform/testing/UnitTestHelpers.h" | 21 #include "platform/testing/UnitTestHelpers.h" |
21 #include "public/platform/Platform.h" | 22 #include "public/platform/Platform.h" |
22 #include "public/platform/WebAddressSpace.h" | 23 #include "public/platform/WebAddressSpace.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 | 25 |
25 namespace blink { | 26 namespace blink { |
26 namespace { | 27 namespace { |
27 | 28 |
28 // A null InProcessWorkerObjectProxy, supplied when creating CompositorWorkerThr
eads. | 29 // A null InProcessWorkerObjectProxy, supplied when creating CompositorWorkerThr
eads. |
29 class TestCompositorWorkerObjectProxy : public InProcessWorkerObjectProxy { | 30 class TestCompositorWorkerObjectProxy : public InProcessWorkerObjectProxy { |
30 public: | 31 public: |
31 static PassOwnPtr<TestCompositorWorkerObjectProxy> create(ExecutionContext*
context) | 32 static PassOwnPtr<TestCompositorWorkerObjectProxy> create(ExecutionContext*
context) |
32 { | 33 { |
33 return adoptPtr(new TestCompositorWorkerObjectProxy(context)); | 34 return adoptPtr(new TestCompositorWorkerObjectProxy(context)); |
34 } | 35 } |
35 | 36 |
36 // (Empty) WorkerReportingProxy implementation: | 37 // (Empty) WorkerReportingProxy implementation: |
37 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL, int exceptionId) {} | 38 virtual void reportException(const String& errorMessage, PassOwnPtr<SourceLo
cation>) {} |
38 void reportConsoleMessage(ConsoleMessage*) override {} | 39 void reportConsoleMessage(ConsoleMessage*) override {} |
39 void postMessageToPageInspector(const String&) override {} | 40 void postMessageToPageInspector(const String&) override {} |
40 void postWorkerConsoleAgentEnabled() override {} | 41 void postWorkerConsoleAgentEnabled() override {} |
41 | 42 |
42 void didEvaluateWorkerScript(bool success) override {} | 43 void didEvaluateWorkerScript(bool success) override {} |
43 void workerGlobalScopeStarted(WorkerGlobalScope*) override {} | 44 void workerGlobalScopeStarted(WorkerGlobalScope*) override {} |
44 void workerGlobalScopeClosed() override {} | 45 void workerGlobalScopeClosed() override {} |
45 void workerThreadTerminated() override {} | 46 void workerThreadTerminated() override {} |
46 void willDestroyWorkerGlobalScope() override {} | 47 void willDestroyWorkerGlobalScope() override {} |
47 | 48 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 v8::Isolate* secondIsolate = secondWorker->isolate(); | 220 v8::Isolate* secondIsolate = secondWorker->isolate(); |
220 ASSERT_TRUE(secondIsolate); | 221 ASSERT_TRUE(secondIsolate); |
221 EXPECT_EQ(firstIsolate, secondIsolate); | 222 EXPECT_EQ(firstIsolate, secondIsolate); |
222 | 223 |
223 // Verify that the isolate can run some scripts correctly in the second work
er. | 224 // Verify that the isolate can run some scripts correctly in the second work
er. |
224 checkWorkerCanExecuteScript(secondWorker.get()); | 225 checkWorkerCanExecuteScript(secondWorker.get()); |
225 secondWorker->terminateAndWait(); | 226 secondWorker->terminateAndWait(); |
226 } | 227 } |
227 | 228 |
228 } // namespace blink | 229 } // namespace blink |
OLD | NEW |