| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/webaudio/AudioWorkletThread.h" | 5 #include "modules/webaudio/AudioWorkletThread.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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 TestAudioWorkletReportingProxy() {} | 56 TestAudioWorkletReportingProxy() {} |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace | 59 } // namespace |
| 60 | 60 |
| 61 class AudioWorkletThreadTest : public ::testing::Test { | 61 class AudioWorkletThreadTest : public ::testing::Test { |
| 62 public: | 62 public: |
| 63 void SetUp() override { | 63 void SetUp() override { |
| 64 AudioWorkletThread::createSharedBackingThreadForTest(); | 64 AudioWorkletThread::ensureSharedBackingThread(); |
| 65 m_reportingProxy = TestAudioWorkletReportingProxy::create(); | 65 m_reportingProxy = TestAudioWorkletReportingProxy::create(); |
| 66 m_securityOrigin = | 66 m_securityOrigin = |
| 67 SecurityOrigin::create(KURL(ParsedURLString, "http://fake.url/")); | 67 SecurityOrigin::create(KURL(ParsedURLString, "http://fake.url/")); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void TearDown() override { AudioWorkletThread::clearSharedBackingThread(); } | 70 void TearDown() override { AudioWorkletThread::clearSharedBackingThread(); } |
| 71 | 71 |
| 72 std::unique_ptr<AudioWorkletThread> createAudioWorkletThread() { | 72 std::unique_ptr<AudioWorkletThread> createAudioWorkletThread() { |
| 73 std::unique_ptr<AudioWorkletThread> thread = | 73 std::unique_ptr<AudioWorkletThread> thread = |
| 74 AudioWorkletThread::create(nullptr, *m_reportingProxy); | 74 AudioWorkletThread::create(nullptr, *m_reportingProxy); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 ASSERT_TRUE(secondIsolate); | 187 ASSERT_TRUE(secondIsolate); |
| 188 EXPECT_EQ(firstIsolate, secondIsolate); | 188 EXPECT_EQ(firstIsolate, secondIsolate); |
| 189 | 189 |
| 190 // Verify that the isolate can run some scripts correctly in the second | 190 // Verify that the isolate can run some scripts correctly in the second |
| 191 // worklet. | 191 // worklet. |
| 192 checkWorkletCanExecuteScript(secondWorklet.get()); | 192 checkWorkletCanExecuteScript(secondWorklet.get()); |
| 193 secondWorklet->terminateAndWait(); | 193 secondWorklet->terminateAndWait(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace blink | 196 } // namespace blink |
| OLD | NEW |