| 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 "core/loader/ThreadableLoader.h" | 5 #include "core/loader/ThreadableLoader.h" |
| 6 | 6 |
| 7 #include "core/loader/DocumentThreadableLoader.h" | 7 #include "core/loader/DocumentThreadableLoader.h" |
| 8 #include "core/loader/ThreadableLoaderClient.h" | 8 #include "core/loader/ThreadableLoaderClient.h" |
| 9 #include "core/loader/WorkerThreadableLoader.h" | 9 #include "core/loader/WorkerThreadableLoader.h" |
| 10 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 crossThreadUnretained(this), | 232 crossThreadUnretained(this), |
| 233 crossThreadUnretained(completionEvent.get()), n)); | 233 crossThreadUnretained(completionEvent.get()), n)); |
| 234 completionEvent->wait(); | 234 completionEvent->wait(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void onSetUp() override { | 237 void onSetUp() override { |
| 238 m_mockWorkerReportingProxy = WTF::makeUnique<MockWorkerReportingProxy>(); | 238 m_mockWorkerReportingProxy = WTF::makeUnique<MockWorkerReportingProxy>(); |
| 239 m_securityOrigin = document().getSecurityOrigin(); | 239 m_securityOrigin = document().getSecurityOrigin(); |
| 240 m_parentFrameTaskRunners = | 240 m_parentFrameTaskRunners = |
| 241 ParentFrameTaskRunners::create(&m_dummyPageHolder->frame()); | 241 ParentFrameTaskRunners::create(&m_dummyPageHolder->frame()); |
| 242 m_workerThread = WTF::wrapUnique(new WorkerThreadForTest( | 242 m_workerThread = WTF::wrapUnique( |
| 243 this, *m_mockWorkerReportingProxy, m_parentFrameTaskRunners.get())); | 243 new WorkerThreadForTest(this, *m_mockWorkerReportingProxy)); |
| 244 | 244 |
| 245 expectWorkerLifetimeReportingCalls(); | 245 expectWorkerLifetimeReportingCalls(); |
| 246 m_workerThread->startWithSourceCode(m_securityOrigin.get(), | 246 m_workerThread->startWithSourceCode(m_securityOrigin.get(), |
| 247 "//fake source code"); | 247 "//fake source code", |
| 248 m_parentFrameTaskRunners.get()); |
| 248 m_workerThread->waitForInit(); | 249 m_workerThread->waitForInit(); |
| 249 } | 250 } |
| 250 | 251 |
| 251 void onServeRequests() override { testing::runPendingTasks(); } | 252 void onServeRequests() override { testing::runPendingTasks(); } |
| 252 | 253 |
| 253 void onTearDown() override { | 254 void onTearDown() override { |
| 254 postTaskToWorkerGlobalScope( | 255 postTaskToWorkerGlobalScope( |
| 255 BLINK_FROM_HERE, | 256 BLINK_FROM_HERE, |
| 256 crossThreadBind(&WorkerThreadableLoaderTestHelper::clearLoader, | 257 crossThreadBind(&WorkerThreadableLoaderTestHelper::clearLoader, |
| 257 crossThreadUnretained(this))); | 258 crossThreadUnretained(this))); |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 // test is not saying that didFailAccessControlCheck should be dispatched | 883 // test is not saying that didFailAccessControlCheck should be dispatched |
| 883 // synchronously, but is saying that even when a response is served | 884 // synchronously, but is saying that even when a response is served |
| 884 // synchronously it should not lead to a crash. | 885 // synchronously it should not lead to a crash. |
| 885 startLoader(KURL(KURL(), "about:blank")); | 886 startLoader(KURL(KURL(), "about:blank")); |
| 886 callCheckpoint(2); | 887 callCheckpoint(2); |
| 887 } | 888 } |
| 888 | 889 |
| 889 } // namespace | 890 } // namespace |
| 890 | 891 |
| 891 } // namespace blink | 892 } // namespace blink |
| OLD | NEW |