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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 DispatchNotificationClickEventCallback callback); | 224 DispatchNotificationClickEventCallback callback); |
225 virtual void OnNotificationCloseEvent( | 225 virtual void OnNotificationCloseEvent( |
226 const std::string& notification_id, | 226 const std::string& notification_id, |
227 const PlatformNotificationData& notification_data, | 227 const PlatformNotificationData& notification_data, |
228 mojom::ServiceWorkerEventDispatcher:: | 228 mojom::ServiceWorkerEventDispatcher:: |
229 DispatchNotificationCloseEventCallback callback); | 229 DispatchNotificationCloseEventCallback callback); |
230 virtual void OnPushEvent( | 230 virtual void OnPushEvent( |
231 const PushEventPayload& payload, | 231 const PushEventPayload& payload, |
232 mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback callback); | 232 mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback callback); |
233 virtual void OnPaymentRequestEvent( | 233 virtual void OnPaymentRequestEvent( |
234 payments::mojom::PaymentAppRequestPtr data, | 234 payments::mojom::PaymentRequestEventDataPtr data, |
235 payments::mojom::PaymentAppResponseCallbackPtr response_callback, | 235 payments::mojom::PaymentAppResponseCallbackPtr response_callback, |
236 mojom::ServiceWorkerEventDispatcher::DispatchPaymentRequestEventCallback | 236 mojom::ServiceWorkerEventDispatcher::DispatchPaymentRequestEventCallback |
237 callback); | 237 callback); |
238 | 238 |
239 // These functions simulate sending an EmbeddedHostMsg message through the | 239 // These functions simulate sending an EmbeddedHostMsg message through the |
240 // legacy IPC system to the browser. | 240 // legacy IPC system to the browser. |
241 void SimulateWorkerReadyForInspection(int embedded_worker_id); | 241 void SimulateWorkerReadyForInspection(int embedded_worker_id); |
242 void SimulateWorkerScriptCached(int embedded_worker_id); | 242 void SimulateWorkerScriptCached(int embedded_worker_id); |
243 void SimulateWorkerScriptLoaded(int embedded_worker_id); | 243 void SimulateWorkerScriptLoaded(int embedded_worker_id); |
244 void SimulateWorkerThreadStarted(int thread_id, | 244 void SimulateWorkerThreadStarted(int thread_id, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 DispatchNotificationClickEventCallback callback); | 309 DispatchNotificationClickEventCallback callback); |
310 void OnNotificationCloseEventStub( | 310 void OnNotificationCloseEventStub( |
311 const std::string& notification_id, | 311 const std::string& notification_id, |
312 const PlatformNotificationData& notification_data, | 312 const PlatformNotificationData& notification_data, |
313 mojom::ServiceWorkerEventDispatcher:: | 313 mojom::ServiceWorkerEventDispatcher:: |
314 DispatchNotificationCloseEventCallback callback); | 314 DispatchNotificationCloseEventCallback callback); |
315 void OnPushEventStub( | 315 void OnPushEventStub( |
316 const PushEventPayload& payload, | 316 const PushEventPayload& payload, |
317 mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback callback); | 317 mojom::ServiceWorkerEventDispatcher::DispatchPushEventCallback callback); |
318 void OnPaymentRequestEventStub( | 318 void OnPaymentRequestEventStub( |
319 payments::mojom::PaymentAppRequestPtr data, | 319 payments::mojom::PaymentRequestEventDataPtr data, |
320 payments::mojom::PaymentAppResponseCallbackPtr response_callback, | 320 payments::mojom::PaymentAppResponseCallbackPtr response_callback, |
321 mojom::ServiceWorkerEventDispatcher::DispatchPaymentRequestEventCallback | 321 mojom::ServiceWorkerEventDispatcher::DispatchPaymentRequestEventCallback |
322 callback); | 322 callback); |
323 | 323 |
324 std::unique_ptr<TestBrowserContext> browser_context_; | 324 std::unique_ptr<TestBrowserContext> browser_context_; |
325 std::unique_ptr<MockRenderProcessHost> render_process_host_; | 325 std::unique_ptr<MockRenderProcessHost> render_process_host_; |
326 std::unique_ptr<MockRenderProcessHost> new_render_process_host_; | 326 std::unique_ptr<MockRenderProcessHost> new_render_process_host_; |
327 | 327 |
328 scoped_refptr<ServiceWorkerContextWrapper> wrapper_; | 328 scoped_refptr<ServiceWorkerContextWrapper> wrapper_; |
329 | 329 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 std::unique_ptr<MockType> mock = | 365 std::unique_ptr<MockType> mock = |
366 base::MakeUnique<MockType>(std::forward<Args>(args)...); | 366 base::MakeUnique<MockType>(std::forward<Args>(args)...); |
367 MockType* mock_rawptr = mock.get(); | 367 MockType* mock_rawptr = mock.get(); |
368 RegisterMockInstanceClient(std::move(mock)); | 368 RegisterMockInstanceClient(std::move(mock)); |
369 return mock_rawptr; | 369 return mock_rawptr; |
370 } | 370 } |
371 | 371 |
372 } // namespace content | 372 } // namespace content |
373 | 373 |
374 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 374 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
OLD | NEW |