| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/workers/WorkerThread.h" | 6 #include "core/workers/WorkerThread.h" |
| 7 | 7 |
| 8 #include "core/inspector/ConsoleMessage.h" | 8 #include "core/inspector/ConsoleMessage.h" |
| 9 #include "core/workers/WorkerReportingProxy.h" | 9 #include "core/workers/WorkerReportingProxy.h" |
| 10 #include "core/workers/WorkerThreadStartupData.h" | 10 #include "core/workers/WorkerThreadStartupData.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void logExceptionToConsole(const String&, int, const String&, int, int, Pass
RefPtrWillBeRawPtr<ScriptCallStack>) override | 76 void logExceptionToConsole(const String&, int, const String&, int, int, Pass
RefPtrWillBeRawPtr<ScriptCallStack>) override |
| 77 { | 77 { |
| 78 } | 78 } |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 class WorkerThreadForTest : public WorkerThread { | 81 class WorkerThreadForTest : public WorkerThread { |
| 82 public: | 82 public: |
| 83 WorkerThreadForTest( | 83 WorkerThreadForTest( |
| 84 WorkerLoaderProxyProvider* mockWorkerLoaderProxyProvider, | 84 WorkerLoaderProxyProvider* mockWorkerLoaderProxyProvider, |
| 85 WorkerReportingProxy& mockWorkerReportingProxy, | 85 WorkerReportingProxy& mockWorkerReportingProxy, |
| 86 PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> workerThreadStartupData) | 86 PassOwnPtr<WorkerThreadStartupData> workerThreadStartupData) |
| 87 : WorkerThread(WorkerLoaderProxy::create(mockWorkerLoaderProxyProvider),
mockWorkerReportingProxy, workerThreadStartupData) | 87 : WorkerThread(WorkerLoaderProxy::create(mockWorkerLoaderProxyProvider),
mockWorkerReportingProxy, workerThreadStartupData) |
| 88 , m_thread(WebThreadSupportingGC::create("Test thread")) | 88 , m_thread(WebThreadSupportingGC::create("Test thread")) |
| 89 { | 89 { |
| 90 } | 90 } |
| 91 | 91 |
| 92 ~WorkerThreadForTest() override { } | 92 ~WorkerThreadForTest() override { } |
| 93 | 93 |
| 94 // WorkerThread implementation: | 94 // WorkerThread implementation: |
| 95 WebThreadSupportingGC& backingThread() override | 95 WebThreadSupportingGC& backingThread() override |
| 96 { | 96 { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 RefPtr<WorkerThreadForTest> m_workerThread; | 176 RefPtr<WorkerThreadForTest> m_workerThread; |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 TEST_F(WorkerThreadTest, StartAndStop) | 179 TEST_F(WorkerThreadTest, StartAndStop) |
| 180 { | 180 { |
| 181 startAndWaitForInit(); | 181 startAndWaitForInit(); |
| 182 m_workerThread->terminateAndWait(); | 182 m_workerThread->terminateAndWait(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace blink | 185 } // namespace blink |
| OLD | NEW |