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

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

Issue 2539443004: Worker: Move ParentFrameTaskRunners from WorkerReportingProxy to ObjectProxy (Closed)
Patch Set: Created 4 years 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/AnimationWorkletThread.h" 5 #include "modules/compositorworker/AnimationWorkletThread.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/SourceLocation.h"
9 #include "bindings/core/v8/V8GCController.h" 9 #include "bindings/core/v8/V8GCController.h"
10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" 10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
11 #include "core/inspector/ConsoleMessage.h" 11 #include "core/inspector/ConsoleMessage.h"
12 #include "core/workers/InProcessWorkerObjectProxy.h" 12 #include "core/workers/InProcessWorkerObjectProxy.h"
13 #include "core/workers/ParentFrameTaskRunners.h"
14 #include "core/workers/WorkerBackingThread.h" 13 #include "core/workers/WorkerBackingThread.h"
15 #include "core/workers/WorkerLoaderProxy.h" 14 #include "core/workers/WorkerLoaderProxy.h"
16 #include "core/workers/WorkerOrWorkletGlobalScope.h" 15 #include "core/workers/WorkerOrWorkletGlobalScope.h"
17 #include "core/workers/WorkerThreadStartupData.h" 16 #include "core/workers/WorkerThreadStartupData.h"
18 #include "platform/CrossThreadFunctional.h" 17 #include "platform/CrossThreadFunctional.h"
19 #include "platform/WaitableEvent.h" 18 #include "platform/WaitableEvent.h"
20 #include "platform/WebThreadSupportingGC.h" 19 #include "platform/WebThreadSupportingGC.h"
21 #include "platform/heap/Handle.h" 20 #include "platform/heap/Handle.h"
22 #include "platform/testing/TestingPlatformSupport.h" 21 #include "platform/testing/TestingPlatformSupport.h"
23 #include "platform/testing/UnitTestHelpers.h" 22 #include "platform/testing/UnitTestHelpers.h"
(...skipping 15 matching lines...) Expand all
39 38
40 // (Empty) WorkerReportingProxy implementation: 39 // (Empty) WorkerReportingProxy implementation:
41 void reportException(const String& errorMessage, 40 void reportException(const String& errorMessage,
42 std::unique_ptr<SourceLocation>, 41 std::unique_ptr<SourceLocation>,
43 int exceptionId) override {} 42 int exceptionId) override {}
44 void reportConsoleMessage(MessageSource, 43 void reportConsoleMessage(MessageSource,
45 MessageLevel, 44 MessageLevel,
46 const String& message, 45 const String& message,
47 SourceLocation*) override {} 46 SourceLocation*) override {}
48 void postMessageToPageInspector(const String&) override {} 47 void postMessageToPageInspector(const String&) override {}
49 ParentFrameTaskRunners* getParentFrameTaskRunners() override {
50 return m_parentFrameTaskRunners.get();
51 }
52
53 void didEvaluateWorkerScript(bool success) override {} 48 void didEvaluateWorkerScript(bool success) override {}
54 void didCloseWorkerGlobalScope() override {} 49 void didCloseWorkerGlobalScope() override {}
55 void willDestroyWorkerGlobalScope() override {} 50 void willDestroyWorkerGlobalScope() override {}
56 void didTerminateWorkerThread() override {} 51 void didTerminateWorkerThread() override {}
57 52
58 private: 53 private:
59 TestAnimationWorkletReportingProxy() 54 TestAnimationWorkletReportingProxy() {}
60 : m_parentFrameTaskRunners(ParentFrameTaskRunners::create(nullptr)) {}
61
62 Persistent<ParentFrameTaskRunners> m_parentFrameTaskRunners;
63 }; 55 };
64 56
65 class AnimationWorkletTestPlatform : public TestingPlatformSupport { 57 class AnimationWorkletTestPlatform : public TestingPlatformSupport {
66 public: 58 public:
67 AnimationWorkletTestPlatform() 59 AnimationWorkletTestPlatform()
68 : m_thread(wrapUnique(m_oldPlatform->createThread("Compositor"))) {} 60 : m_thread(wrapUnique(m_oldPlatform->createThread("Compositor"))) {}
69 61
70 WebThread* compositorThread() const override { return m_thread.get(); } 62 WebThread* compositorThread() const override { return m_thread.get(); }
71 63
72 WebCompositorSupport* compositorSupport() override { 64 WebCompositorSupport* compositorSupport() override {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 ASSERT_TRUE(secondIsolate); 210 ASSERT_TRUE(secondIsolate);
219 EXPECT_EQ(firstIsolate, secondIsolate); 211 EXPECT_EQ(firstIsolate, secondIsolate);
220 212
221 // Verify that the isolate can run some scripts correctly in the second 213 // Verify that the isolate can run some scripts correctly in the second
222 // worklet. 214 // worklet.
223 checkWorkletCanExecuteScript(secondWorklet.get()); 215 checkWorkletCanExecuteScript(secondWorklet.get());
224 secondWorklet->terminateAndWait(); 216 secondWorklet->terminateAndWait();
225 } 217 }
226 218
227 } // namespace blink 219 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698