| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 shell::InterfaceRegistry* interface_registry); | 171 shell::InterfaceRegistry* interface_registry); |
| 172 | 172 |
| 173 // On*Event handlers. Called by the default implementation of | 173 // On*Event handlers. Called by the default implementation of |
| 174 // OnMessageToWorker when events are sent to the embedded | 174 // OnMessageToWorker when events are sent to the embedded |
| 175 // worker. By default they just return success via | 175 // worker. By default they just return success via |
| 176 // SimulateSendReplyToBrowser. | 176 // SimulateSendReplyToBrowser. |
| 177 virtual void OnActivateEvent(int embedded_worker_id, int request_id); | 177 virtual void OnActivateEvent(int embedded_worker_id, int request_id); |
| 178 virtual void OnExtendableMessageEvent(int embedded_worker_id, int request_id); | 178 virtual void OnExtendableMessageEvent(int embedded_worker_id, int request_id); |
| 179 virtual void OnInstallEvent(int embedded_worker_id, int request_id); | 179 virtual void OnInstallEvent(int embedded_worker_id, int request_id); |
| 180 virtual void OnFetchEvent(int embedded_worker_id, | 180 virtual void OnFetchEvent(int embedded_worker_id, |
| 181 int response_id, | 181 int fetch_event_id, |
| 182 const ServiceWorkerFetchRequest& request, | 182 const ServiceWorkerFetchRequest& request, |
| 183 const FetchCallback& callback); | 183 const FetchCallback& callback); |
| 184 virtual void OnPushEvent(int embedded_worker_id, | 184 virtual void OnPushEvent(int embedded_worker_id, |
| 185 int request_id, | 185 int request_id, |
| 186 const PushEventPayload& payload); | 186 const PushEventPayload& payload); |
| 187 | 187 |
| 188 // These functions simulate sending an EmbeddedHostMsg message to the | 188 // These functions simulate sending an EmbeddedHostMsg message to the |
| 189 // browser. | 189 // browser. |
| 190 void SimulateWorkerReadyForInspection(int embedded_worker_id); | 190 void SimulateWorkerReadyForInspection(int embedded_worker_id); |
| 191 void SimulateWorkerScriptCached(int embedded_worker_id); | 191 void SimulateWorkerScriptCached(int embedded_worker_id); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 211 void OnStopWorkerStub(int embedded_worker_id); | 211 void OnStopWorkerStub(int embedded_worker_id); |
| 212 void OnMessageToWorkerStub(int thread_id, | 212 void OnMessageToWorkerStub(int thread_id, |
| 213 int embedded_worker_id, | 213 int embedded_worker_id, |
| 214 const IPC::Message& message); | 214 const IPC::Message& message); |
| 215 void OnActivateEventStub(int request_id); | 215 void OnActivateEventStub(int request_id); |
| 216 void OnExtendableMessageEventStub( | 216 void OnExtendableMessageEventStub( |
| 217 int request_id, | 217 int request_id, |
| 218 const ServiceWorkerMsg_ExtendableMessageEvent_Params& params); | 218 const ServiceWorkerMsg_ExtendableMessageEvent_Params& params); |
| 219 void OnInstallEventStub(int request_id); | 219 void OnInstallEventStub(int request_id); |
| 220 void OnFetchEventStub(int thread_id, | 220 void OnFetchEventStub(int thread_id, |
| 221 int response_id, | 221 int fetch_event_id, |
| 222 const ServiceWorkerFetchRequest& request, | 222 const ServiceWorkerFetchRequest& request, |
| 223 const FetchCallback& callback); | 223 const FetchCallback& callback); |
| 224 void OnPushEventStub(int request_id, const PushEventPayload& payload); | 224 void OnPushEventStub(int request_id, const PushEventPayload& payload); |
| 225 void OnSetupMojoStub(int thread_id, | 225 void OnSetupMojoStub(int thread_id, |
| 226 shell::mojom::InterfaceProviderRequest services, | 226 shell::mojom::InterfaceProviderRequest services, |
| 227 shell::mojom::InterfaceProviderPtr exposed_services); | 227 shell::mojom::InterfaceProviderPtr exposed_services); |
| 228 | 228 |
| 229 MessagePortMessageFilter* NewMessagePortMessageFilter(); | 229 MessagePortMessageFilter* NewMessagePortMessageFilter(); |
| 230 | 230 |
| 231 std::unique_ptr<shell::InterfaceRegistry> CreateInterfaceRegistry( | 231 std::unique_ptr<shell::InterfaceRegistry> CreateInterfaceRegistry( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 message_port_message_filters_; | 268 message_port_message_filters_; |
| 269 | 269 |
| 270 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; | 270 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; |
| 271 | 271 |
| 272 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); | 272 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 } // namespace content | 275 } // namespace content |
| 276 | 276 |
| 277 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 277 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| OLD | NEW |