Chromium Code Reviews| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 virtual void OnSetupMojo(ServiceRegistry* service_registry); | 119 virtual void OnSetupMojo(ServiceRegistry* service_registry); |
| 120 | 120 |
| 121 // On*Event handlers. Called by the default implementation of | 121 // On*Event handlers. Called by the default implementation of |
| 122 // OnMessageToWorker when events are sent to the embedded | 122 // OnMessageToWorker when events are sent to the embedded |
| 123 // worker. By default they just return success via | 123 // worker. By default they just return success via |
| 124 // SimulateSendReplyToBrowser. | 124 // SimulateSendReplyToBrowser. |
| 125 virtual void OnActivateEvent(int embedded_worker_id, int request_id); | 125 virtual void OnActivateEvent(int embedded_worker_id, int request_id); |
| 126 virtual void OnExtendableMessageEvent(int embedded_worker_id, int request_id); | 126 virtual void OnExtendableMessageEvent(int embedded_worker_id, int request_id); |
| 127 virtual void OnInstallEvent(int embedded_worker_id, int request_id); | 127 virtual void OnInstallEvent(int embedded_worker_id, int request_id); |
| 128 virtual void OnFetchEvent(int embedded_worker_id, | 128 virtual void OnFetchEvent(int embedded_worker_id, |
| 129 int request_id, | 129 int response_request_id, |
| 130 int finish_request_id, | |
| 130 const ServiceWorkerFetchRequest& request); | 131 const ServiceWorkerFetchRequest& request); |
| 131 virtual void OnPushEvent(int embedded_worker_id, | 132 virtual void OnPushEvent(int embedded_worker_id, |
| 132 int request_id, | 133 int request_id, |
| 133 const PushEventPayload& payload); | 134 const PushEventPayload& payload); |
| 134 | 135 |
| 135 // These functions simulate sending an EmbeddedHostMsg message to the | 136 // These functions simulate sending an EmbeddedHostMsg message to the |
| 136 // browser. | 137 // browser. |
| 137 void SimulateWorkerReadyForInspection(int embedded_worker_id); | 138 void SimulateWorkerReadyForInspection(int embedded_worker_id); |
| 138 void SimulateWorkerScriptCached(int embedded_worker_id); | 139 void SimulateWorkerScriptCached(int embedded_worker_id); |
| 139 void SimulateWorkerScriptLoaded(int embedded_worker_id); | 140 void SimulateWorkerScriptLoaded(int embedded_worker_id); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 152 void OnResumeAfterDownloadStub(int embedded_worker_id); | 153 void OnResumeAfterDownloadStub(int embedded_worker_id); |
| 153 void OnStopWorkerStub(int embedded_worker_id); | 154 void OnStopWorkerStub(int embedded_worker_id); |
| 154 void OnMessageToWorkerStub(int thread_id, | 155 void OnMessageToWorkerStub(int thread_id, |
| 155 int embedded_worker_id, | 156 int embedded_worker_id, |
| 156 const IPC::Message& message); | 157 const IPC::Message& message); |
| 157 void OnActivateEventStub(int request_id); | 158 void OnActivateEventStub(int request_id); |
| 158 void OnExtendableMessageEventStub( | 159 void OnExtendableMessageEventStub( |
| 159 int request_id, | 160 int request_id, |
| 160 const ServiceWorkerMsg_ExtendableMessageEvent_Params& params); | 161 const ServiceWorkerMsg_ExtendableMessageEvent_Params& params); |
| 161 void OnInstallEventStub(int request_id); | 162 void OnInstallEventStub(int request_id); |
| 162 void OnFetchEventStub(int request_id, | 163 void OnFetchEventStub(int response_request_id, |
| 164 int event_request_id, | |
|
falken
2016/06/09 19:28:48
There is some inconsistency throughout this patch
shimazu
2016/06/10 10:26:49
Done.
| |
| 163 const ServiceWorkerFetchRequest& request); | 165 const ServiceWorkerFetchRequest& request); |
| 164 void OnPushEventStub(int request_id, const PushEventPayload& payload); | 166 void OnPushEventStub(int request_id, const PushEventPayload& payload); |
| 165 void OnSetupMojoStub(int thread_id, | 167 void OnSetupMojoStub(int thread_id, |
| 166 shell::mojom::InterfaceProviderRequest services, | 168 shell::mojom::InterfaceProviderRequest services, |
| 167 shell::mojom::InterfaceProviderPtr exposed_services); | 169 shell::mojom::InterfaceProviderPtr exposed_services); |
| 168 | 170 |
| 169 MessagePortMessageFilter* NewMessagePortMessageFilter(); | 171 MessagePortMessageFilter* NewMessagePortMessageFilter(); |
| 170 | 172 |
| 171 std::unique_ptr<TestBrowserContext> browser_context_; | 173 std::unique_ptr<TestBrowserContext> browser_context_; |
| 172 std::unique_ptr<MockRenderProcessHost> render_process_host_; | 174 std::unique_ptr<MockRenderProcessHost> render_process_host_; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 195 message_port_message_filters_; | 197 message_port_message_filters_; |
| 196 | 198 |
| 197 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; | 199 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; |
| 198 | 200 |
| 199 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); | 201 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); |
| 200 }; | 202 }; |
| 201 | 203 |
| 202 } // namespace content | 204 } // namespace content |
| 203 | 205 |
| 204 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 206 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| OLD | NEW |