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/events/MessageEvent.h" | 5 #include "core/events/MessageEvent.h" |
6 #include "core/inspector/ConsoleMessageStorage.h" | 6 #include "core/inspector/ConsoleMessageStorage.h" |
7 #include "core/testing/DummyPageHolder.h" | 7 #include "core/testing/DummyPageHolder.h" |
8 #include "core/workers/DedicatedWorkerGlobalScope.h" | 8 #include "core/workers/DedicatedWorkerGlobalScope.h" |
9 #include "core/workers/DedicatedWorkerThread.h" | 9 #include "core/workers/DedicatedWorkerThread.h" |
10 #include "core/workers/InProcessWorkerMessagingProxy.h" | 10 #include "core/workers/InProcessWorkerMessagingProxy.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 211 } |
212 | 212 |
213 void TearDown() override { | 213 void TearDown() override { |
214 workerThread()->terminate(); | 214 workerThread()->terminate(); |
215 EXPECT_EQ(Notification::ThreadTerminated, | 215 EXPECT_EQ(Notification::ThreadTerminated, |
216 workerMessagingProxy()->waitForNotification()); | 216 workerMessagingProxy()->waitForNotification()); |
217 } | 217 } |
218 | 218 |
219 void dispatchMessageEvent() { | 219 void dispatchMessageEvent() { |
220 workerMessagingProxy()->postMessageToWorkerGlobalScope( | 220 workerMessagingProxy()->postMessageToWorkerGlobalScope( |
221 nullptr /* message */, nullptr /* channels */); | 221 nullptr /* message */, MessagePortChannelArray()); |
222 } | 222 } |
223 | 223 |
224 InProcessWorkerMessagingProxyForTest* workerMessagingProxy() { | 224 InProcessWorkerMessagingProxyForTest* workerMessagingProxy() { |
225 return m_workerMessagingProxy.get(); | 225 return m_workerMessagingProxy.get(); |
226 } | 226 } |
227 | 227 |
228 DedicatedWorkerThreadForTest* workerThread() { | 228 DedicatedWorkerThreadForTest* workerThread() { |
229 return m_workerMessagingProxy->workerThread(); | 229 return m_workerMessagingProxy->workerThread(); |
230 } | 230 } |
231 | 231 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 EXPECT_FALSE(UseCounter::isCounted(document(), feature2)); | 400 EXPECT_FALSE(UseCounter::isCounted(document(), feature2)); |
401 workerThread()->postTask( | 401 workerThread()->postTask( |
402 BLINK_FROM_HERE, | 402 BLINK_FROM_HERE, |
403 crossThreadBind(&DedicatedWorkerThreadForTest::countDeprecation, | 403 crossThreadBind(&DedicatedWorkerThreadForTest::countDeprecation, |
404 crossThreadUnretained(workerThread()), feature2)); | 404 crossThreadUnretained(workerThread()), feature2)); |
405 testing::enterRunLoop(); | 405 testing::enterRunLoop(); |
406 EXPECT_TRUE(UseCounter::isCounted(document(), feature2)); | 406 EXPECT_TRUE(UseCounter::isCounted(document(), feature2)); |
407 } | 407 } |
408 | 408 |
409 } // namespace blink | 409 } // namespace blink |
OLD | NEW |