| 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 "public/web/WebEmbeddedWorker.h" | 5 #include "public/web/WebEmbeddedWorker.h" |
| 6 | 6 |
| 7 #include "platform/testing/URLTestHelpers.h" | 7 #include "platform/testing/URLTestHelpers.h" |
| 8 #include "platform/testing/UnitTestHelpers.h" | 8 #include "platform/testing/UnitTestHelpers.h" |
| 9 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
| 10 #include "public/platform/WebURLLoaderMockFactory.h" | 10 #include "public/platform/WebURLLoaderMockFactory.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 MOCK_METHOD0(workerScriptLoaded, void()); | 31 MOCK_METHOD0(workerScriptLoaded, void()); |
| 32 MOCK_METHOD1(createServiceWorkerNetworkProvider, | 32 MOCK_METHOD1(createServiceWorkerNetworkProvider, |
| 33 WebServiceWorkerNetworkProvider*(WebDataSource*)); | 33 WebServiceWorkerNetworkProvider*(WebDataSource*)); |
| 34 MOCK_METHOD0(createServiceWorkerProvider, WebServiceWorkerProvider*()); | 34 MOCK_METHOD0(createServiceWorkerProvider, WebServiceWorkerProvider*()); |
| 35 bool hasAssociatedRegistration() override { | 35 bool hasAssociatedRegistration() override { |
| 36 return m_hasAssociatedRegistration; | 36 return m_hasAssociatedRegistration; |
| 37 } | 37 } |
| 38 void setHasAssociatedRegistration(bool hasAssociatedRegistration) { | 38 void setHasAssociatedRegistration(bool hasAssociatedRegistration) { |
| 39 m_hasAssociatedRegistration = hasAssociatedRegistration; | 39 m_hasAssociatedRegistration = hasAssociatedRegistration; |
| 40 } | 40 } |
| 41 void getClient(const WebString&, WebServiceWorkerClientCallbacks*) override { | 41 void getClient(const WebString&, |
| 42 std::unique_ptr<WebServiceWorkerClientCallbacks>) override { |
| 42 NOTREACHED(); | 43 NOTREACHED(); |
| 43 } | 44 } |
| 44 void getClients(const WebServiceWorkerClientQueryOptions&, | 45 void getClients(const WebServiceWorkerClientQueryOptions&, |
| 45 WebServiceWorkerClientsCallbacks*) override { | 46 std::unique_ptr<WebServiceWorkerClientsCallbacks>) override { |
| 46 NOTREACHED(); | 47 NOTREACHED(); |
| 47 } | 48 } |
| 48 void openWindow(const WebURL&, WebServiceWorkerClientCallbacks*) override { | 49 void openWindow(const WebURL&, |
| 50 std::unique_ptr<WebServiceWorkerClientCallbacks>) override { |
| 49 NOTREACHED(); | 51 NOTREACHED(); |
| 50 } | 52 } |
| 51 void postMessageToClient(const WebString& uuid, | 53 void postMessageToClient(const WebString& uuid, |
| 52 const WebString&, | 54 const WebString&, |
| 53 WebMessagePortChannelArray*) override { | 55 WebMessagePortChannelArray*) override { |
| 54 NOTREACHED(); | 56 NOTREACHED(); |
| 55 } | 57 } |
| 56 void postMessageToCrossOriginClient(const WebCrossOriginServiceWorkerClient&, | 58 void postMessageToCrossOriginClient(const WebCrossOriginServiceWorkerClient&, |
| 57 const WebString&, | 59 const WebString&, |
| 58 WebMessagePortChannelArray*) override { | 60 WebMessagePortChannelArray*) override { |
| 59 NOTREACHED(); | 61 NOTREACHED(); |
| 60 } | 62 } |
| 61 void skipWaiting(WebServiceWorkerSkipWaitingCallbacks*) override { | 63 void skipWaiting( |
| 64 std::unique_ptr<WebServiceWorkerSkipWaitingCallbacks>) override { |
| 62 NOTREACHED(); | 65 NOTREACHED(); |
| 63 } | 66 } |
| 64 void claim(WebServiceWorkerClientsClaimCallbacks*) override { NOTREACHED(); } | 67 void claim(std::unique_ptr<WebServiceWorkerClientsClaimCallbacks>) override { |
| 65 void focus(const WebString& uuid, WebServiceWorkerClientCallbacks*) override { | 68 NOTREACHED(); |
| 69 } |
| 70 void focus(const WebString& uuid, |
| 71 std::unique_ptr<WebServiceWorkerClientCallbacks>) override { |
| 66 NOTREACHED(); | 72 NOTREACHED(); |
| 67 } | 73 } |
| 68 void navigate(const WebString& uuid, | 74 void navigate(const WebString& uuid, |
| 69 const WebURL&, | 75 const WebURL&, |
| 70 WebServiceWorkerClientCallbacks*) override { | 76 std::unique_ptr<WebServiceWorkerClientCallbacks>) override { |
| 71 NOTREACHED(); | 77 NOTREACHED(); |
| 72 } | 78 } |
| 73 void registerForeignFetchScopes( | 79 void registerForeignFetchScopes( |
| 74 const WebVector<WebURL>& subScopes, | 80 const WebVector<WebURL>& subScopes, |
| 75 const WebVector<WebSecurityOrigin>& origins) override { | 81 const WebVector<WebSecurityOrigin>& origins) override { |
| 76 NOTREACHED(); | 82 NOTREACHED(); |
| 77 } | 83 } |
| 78 | 84 |
| 79 private: | 85 private: |
| 80 bool m_hasAssociatedRegistration; | 86 bool m_hasAssociatedRegistration; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); | 290 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); |
| 285 | 291 |
| 286 // Resume after download. | 292 // Resume after download. |
| 287 EXPECT_CALL(*m_mockClient, createServiceWorkerProvider()) | 293 EXPECT_CALL(*m_mockClient, createServiceWorkerProvider()) |
| 288 .WillOnce(::testing::Return(nullptr)); | 294 .WillOnce(::testing::Return(nullptr)); |
| 289 m_worker->resumeAfterDownload(); | 295 m_worker->resumeAfterDownload(); |
| 290 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); | 296 ::testing::Mock::VerifyAndClearExpectations(m_mockClient); |
| 291 } | 297 } |
| 292 | 298 |
| 293 } // namespace blink | 299 } // namespace blink |
| OLD | NEW |