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

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

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)
Patch Set: fix crash Created 3 years, 11 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/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"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 90
91 std::unique_ptr<AnimationWorkletThread> createAnimationWorkletThread() { 91 std::unique_ptr<AnimationWorkletThread> createAnimationWorkletThread() {
92 std::unique_ptr<AnimationWorkletThread> thread = 92 std::unique_ptr<AnimationWorkletThread> thread =
93 AnimationWorkletThread::create(nullptr, *m_reportingProxy, 93 AnimationWorkletThread::create(nullptr, *m_reportingProxy,
94 ParentFrameTaskRunners::create(nullptr)); 94 ParentFrameTaskRunners::create(nullptr));
95 thread->start(WorkerThreadStartupData::create( 95 thread->start(WorkerThreadStartupData::create(
96 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", "", 96 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", "",
97 nullptr, DontPauseWorkerGlobalScopeOnStart, nullptr, "", 97 nullptr, DontPauseWorkerGlobalScopeOnStart, nullptr, "",
98 m_securityOrigin.get(), nullptr, WebAddressSpaceLocal, nullptr, nullptr, 98 m_securityOrigin.get(), nullptr, WebAddressSpaceLocal, nullptr, nullptr,
99 WorkerV8Settings::Default())); 99 WorkerV8Settings::Default(), false /* inspectorNetworkCapability */));
100 return thread; 100 return thread;
101 } 101 }
102 102
103 // Attempts to run some simple script for |thread|. 103 // Attempts to run some simple script for |thread|.
104 void checkWorkletCanExecuteScript(WorkerThread* thread) { 104 void checkWorkletCanExecuteScript(WorkerThread* thread) {
105 std::unique_ptr<WaitableEvent> waitEvent = WTF::makeUnique<WaitableEvent>(); 105 std::unique_ptr<WaitableEvent> waitEvent = WTF::makeUnique<WaitableEvent>();
106 thread->workerBackingThread().backingThread().postTask( 106 thread->workerBackingThread().backingThread().postTask(
107 BLINK_FROM_HERE, 107 BLINK_FROM_HERE,
108 crossThreadBind(&AnimationWorkletThreadTest::executeScriptInWorklet, 108 crossThreadBind(&AnimationWorkletThreadTest::executeScriptInWorklet,
109 crossThreadUnretained(this), 109 crossThreadUnretained(this),
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 ASSERT_TRUE(secondIsolate); 216 ASSERT_TRUE(secondIsolate);
217 EXPECT_EQ(firstIsolate, secondIsolate); 217 EXPECT_EQ(firstIsolate, secondIsolate);
218 218
219 // Verify that the isolate can run some scripts correctly in the second 219 // Verify that the isolate can run some scripts correctly in the second
220 // worklet. 220 // worklet.
221 checkWorkletCanExecuteScript(secondWorklet.get()); 221 checkWorkletCanExecuteScript(secondWorklet.get());
222 secondWorklet->terminateAndWait(); 222 secondWorklet->terminateAndWait();
223 } 223 }
224 224
225 } // namespace blink 225 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698