| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 virtual void OnInstallEvent(int embedded_worker_id, int request_id); | 187 virtual void OnInstallEvent(int embedded_worker_id, int request_id); |
| 188 virtual void OnFetchEvent(int embedded_worker_id, | 188 virtual void OnFetchEvent(int embedded_worker_id, |
| 189 int fetch_event_id, | 189 int fetch_event_id, |
| 190 const ServiceWorkerFetchRequest& request, | 190 const ServiceWorkerFetchRequest& request, |
| 191 mojom::FetchEventPreloadHandlePtr preload_handle, | 191 mojom::FetchEventPreloadHandlePtr preload_handle, |
| 192 const FetchCallback& callback); | 192 const FetchCallback& callback); |
| 193 virtual void OnPushEvent( | 193 virtual void OnPushEvent( |
| 194 const PushEventPayload& payload, | 194 const PushEventPayload& payload, |
| 195 const mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback& | 195 const mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback& |
| 196 callback); | 196 callback); |
| 197 virtual void OnPaymentRequestEvent( |
| 198 payments::mojom::PaymentAppRequestDataPtr data, |
| 199 const mojom::ServiceWorkerEventDispatcher:: |
| 200 DispatchPaymentRequestEventCallback& callback); |
| 197 | 201 |
| 198 // These functions simulate sending an EmbeddedHostMsg message through the | 202 // These functions simulate sending an EmbeddedHostMsg message through the |
| 199 // legacy IPC system to the browser. | 203 // legacy IPC system to the browser. |
| 200 void SimulateWorkerReadyForInspection(int embedded_worker_id); | 204 void SimulateWorkerReadyForInspection(int embedded_worker_id); |
| 201 void SimulateWorkerScriptCached(int embedded_worker_id); | 205 void SimulateWorkerScriptCached(int embedded_worker_id); |
| 202 void SimulateWorkerScriptLoaded(int embedded_worker_id); | 206 void SimulateWorkerScriptLoaded(int embedded_worker_id); |
| 203 void SimulateWorkerThreadStarted(int thread_id, int embedded_worker_id); | 207 void SimulateWorkerThreadStarted(int thread_id, int embedded_worker_id); |
| 204 void SimulateWorkerScriptEvaluated(int embedded_worker_id, bool success); | 208 void SimulateWorkerScriptEvaluated(int embedded_worker_id, bool success); |
| 205 void SimulateWorkerStarted(int embedded_worker_id); | 209 void SimulateWorkerStarted(int embedded_worker_id); |
| 206 void SimulateWorkerStopped(int embedded_worker_id); | 210 void SimulateWorkerStopped(int embedded_worker_id); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 228 void OnInstallEventStub(int request_id); | 232 void OnInstallEventStub(int request_id); |
| 229 void OnFetchEventStub(int thread_id, | 233 void OnFetchEventStub(int thread_id, |
| 230 int fetch_event_id, | 234 int fetch_event_id, |
| 231 const ServiceWorkerFetchRequest& request, | 235 const ServiceWorkerFetchRequest& request, |
| 232 mojom::FetchEventPreloadHandlePtr preload_handle, | 236 mojom::FetchEventPreloadHandlePtr preload_handle, |
| 233 const FetchCallback& callback); | 237 const FetchCallback& callback); |
| 234 void OnPushEventStub( | 238 void OnPushEventStub( |
| 235 const PushEventPayload& payload, | 239 const PushEventPayload& payload, |
| 236 const mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback& | 240 const mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback& |
| 237 callback); | 241 callback); |
| 242 void OnPaymentRequestEventStub( |
| 243 payments::mojom::PaymentAppRequestDataPtr data, |
| 244 const mojom::ServiceWorkerEventDispatcher:: |
| 245 DispatchPaymentRequestEventCallback& callback); |
| 238 | 246 |
| 239 MessagePortMessageFilter* NewMessagePortMessageFilter(); | 247 MessagePortMessageFilter* NewMessagePortMessageFilter(); |
| 240 | 248 |
| 241 std::unique_ptr<service_manager::InterfaceRegistry> CreateInterfaceRegistry( | 249 std::unique_ptr<service_manager::InterfaceRegistry> CreateInterfaceRegistry( |
| 242 MockRenderProcessHost* rph); | 250 MockRenderProcessHost* rph); |
| 243 | 251 |
| 244 std::unique_ptr<TestBrowserContext> browser_context_; | 252 std::unique_ptr<TestBrowserContext> browser_context_; |
| 245 std::unique_ptr<MockRenderProcessHost> render_process_host_; | 253 std::unique_ptr<MockRenderProcessHost> render_process_host_; |
| 246 std::unique_ptr<MockRenderProcessHost> new_render_process_host_; | 254 std::unique_ptr<MockRenderProcessHost> new_render_process_host_; |
| 247 | 255 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 std::unique_ptr<MockType> mock = | 292 std::unique_ptr<MockType> mock = |
| 285 base::MakeUnique<MockType>(std::forward<Args>(args)...); | 293 base::MakeUnique<MockType>(std::forward<Args>(args)...); |
| 286 MockType* mock_rawptr = mock.get(); | 294 MockType* mock_rawptr = mock.get(); |
| 287 RegisterMockInstanceClient(std::move(mock)); | 295 RegisterMockInstanceClient(std::move(mock)); |
| 288 return mock_rawptr; | 296 return mock_rawptr; |
| 289 } | 297 } |
| 290 | 298 |
| 291 } // namespace content | 299 } // namespace content |
| 292 | 300 |
| 293 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 301 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| OLD | NEW |