Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: content/browser/service_worker/embedded_worker_test_helper.h

Issue 2034663002: ServiceWorker: Keep the worker alive until FetchEvent.waitUntil settles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_test_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 virtual void OnSetupMojo(ServiceRegistry* service_registry); 124 virtual void OnSetupMojo(ServiceRegistry* service_registry);
125 125
126 // On*Event handlers. Called by the default implementation of 126 // On*Event handlers. Called by the default implementation of
127 // OnMessageToWorker when events are sent to the embedded 127 // OnMessageToWorker when events are sent to the embedded
128 // worker. By default they just return success via 128 // worker. By default they just return success via
129 // SimulateSendReplyToBrowser. 129 // SimulateSendReplyToBrowser.
130 virtual void OnActivateEvent(int embedded_worker_id, int request_id); 130 virtual void OnActivateEvent(int embedded_worker_id, int request_id);
131 virtual void OnExtendableMessageEvent(int embedded_worker_id, int request_id); 131 virtual void OnExtendableMessageEvent(int embedded_worker_id, int request_id);
132 virtual void OnInstallEvent(int embedded_worker_id, int request_id); 132 virtual void OnInstallEvent(int embedded_worker_id, int request_id);
133 virtual void OnFetchEvent(int embedded_worker_id, 133 virtual void OnFetchEvent(int embedded_worker_id,
134 int request_id, 134 int response_id,
135 int event_finish_id,
135 const ServiceWorkerFetchRequest& request); 136 const ServiceWorkerFetchRequest& request);
136 virtual void OnPushEvent(int embedded_worker_id, 137 virtual void OnPushEvent(int embedded_worker_id,
137 int request_id, 138 int request_id,
138 const PushEventPayload& payload); 139 const PushEventPayload& payload);
139 140
140 // These functions simulate sending an EmbeddedHostMsg message to the 141 // These functions simulate sending an EmbeddedHostMsg message to the
141 // browser. 142 // browser.
142 void SimulateWorkerReadyForInspection(int embedded_worker_id); 143 void SimulateWorkerReadyForInspection(int embedded_worker_id);
143 void SimulateWorkerScriptCached(int embedded_worker_id); 144 void SimulateWorkerScriptCached(int embedded_worker_id);
144 void SimulateWorkerScriptLoaded(int embedded_worker_id); 145 void SimulateWorkerScriptLoaded(int embedded_worker_id);
(...skipping 12 matching lines...) Expand all
157 void OnResumeAfterDownloadStub(int embedded_worker_id); 158 void OnResumeAfterDownloadStub(int embedded_worker_id);
158 void OnStopWorkerStub(int embedded_worker_id); 159 void OnStopWorkerStub(int embedded_worker_id);
159 void OnMessageToWorkerStub(int thread_id, 160 void OnMessageToWorkerStub(int thread_id,
160 int embedded_worker_id, 161 int embedded_worker_id,
161 const IPC::Message& message); 162 const IPC::Message& message);
162 void OnActivateEventStub(int request_id); 163 void OnActivateEventStub(int request_id);
163 void OnExtendableMessageEventStub( 164 void OnExtendableMessageEventStub(
164 int request_id, 165 int request_id,
165 const ServiceWorkerMsg_ExtendableMessageEvent_Params& params); 166 const ServiceWorkerMsg_ExtendableMessageEvent_Params& params);
166 void OnInstallEventStub(int request_id); 167 void OnInstallEventStub(int request_id);
167 void OnFetchEventStub(int request_id, 168 void OnFetchEventStub(int response_id,
169 int event_finish_id,
168 const ServiceWorkerFetchRequest& request); 170 const ServiceWorkerFetchRequest& request);
169 void OnPushEventStub(int request_id, const PushEventPayload& payload); 171 void OnPushEventStub(int request_id, const PushEventPayload& payload);
170 void OnSetupMojoStub(int thread_id, 172 void OnSetupMojoStub(int thread_id,
171 shell::mojom::InterfaceProviderRequest services, 173 shell::mojom::InterfaceProviderRequest services,
172 shell::mojom::InterfaceProviderPtr exposed_services); 174 shell::mojom::InterfaceProviderPtr exposed_services);
173 175
174 MessagePortMessageFilter* NewMessagePortMessageFilter(); 176 MessagePortMessageFilter* NewMessagePortMessageFilter();
175 177
176 std::unique_ptr<TestBrowserContext> browser_context_; 178 std::unique_ptr<TestBrowserContext> browser_context_;
177 std::unique_ptr<MockRenderProcessHost> render_process_host_; 179 std::unique_ptr<MockRenderProcessHost> render_process_host_;
(...skipping 22 matching lines...) Expand all
200 message_port_message_filters_; 202 message_port_message_filters_;
201 203
202 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; 204 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_;
203 205
204 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); 206 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper);
205 }; 207 };
206 208
207 } // namespace content 209 } // namespace content
208 210
209 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ 211 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698