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

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

Issue 2002883002: ServiceWorker: Store the existence of fetch event handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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/service_worker_browsertest.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 #include "content/browser/service_worker/embedded_worker_test_helper.h" 5 #include "content/browser/service_worker/embedded_worker_test_helper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 SimulateSend(new ServiceWorkerHostMsg_ExtendableMessageEventFinished( 216 SimulateSend(new ServiceWorkerHostMsg_ExtendableMessageEventFinished(
217 embedded_worker_id, request_id, 217 embedded_worker_id, request_id,
218 blink::WebServiceWorkerEventResultCompleted)); 218 blink::WebServiceWorkerEventResultCompleted));
219 } 219 }
220 220
221 void EmbeddedWorkerTestHelper::OnInstallEvent(int embedded_worker_id, 221 void EmbeddedWorkerTestHelper::OnInstallEvent(int embedded_worker_id,
222 int request_id) { 222 int request_id) {
223 // The installing worker may have been doomed and terminated. 223 // The installing worker may have been doomed and terminated.
224 if (!registry()->GetWorker(embedded_worker_id)) 224 if (!registry()->GetWorker(embedded_worker_id))
225 return; 225 return;
226 SimulateSend( 226 SimulateSend(new ServiceWorkerHostMsg_InstallEventFinished(
227 new ServiceWorkerHostMsg_InstallEventFinished( 227 embedded_worker_id, request_id,
228 embedded_worker_id, request_id, 228 blink::WebServiceWorkerEventResultCompleted, true));
229 blink::WebServiceWorkerEventResultCompleted));
230 } 229 }
231 230
232 void EmbeddedWorkerTestHelper::OnFetchEvent( 231 void EmbeddedWorkerTestHelper::OnFetchEvent(
233 int embedded_worker_id, 232 int embedded_worker_id,
234 int request_id, 233 int request_id,
235 const ServiceWorkerFetchRequest& request) { 234 const ServiceWorkerFetchRequest& request) {
236 SimulateSend(new ServiceWorkerHostMsg_FetchEventFinished( 235 SimulateSend(new ServiceWorkerHostMsg_FetchEventFinished(
237 embedded_worker_id, request_id, 236 embedded_worker_id, request_id,
238 SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE, 237 SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE,
239 ServiceWorkerResponse( 238 ServiceWorkerResponse(
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 437
439 MessagePortMessageFilter* 438 MessagePortMessageFilter*
440 EmbeddedWorkerTestHelper::NewMessagePortMessageFilter() { 439 EmbeddedWorkerTestHelper::NewMessagePortMessageFilter() {
441 scoped_refptr<MessagePortMessageFilter> filter( 440 scoped_refptr<MessagePortMessageFilter> filter(
442 new MockMessagePortMessageFilter); 441 new MockMessagePortMessageFilter);
443 message_port_message_filters_.push_back(filter); 442 message_port_message_filters_.push_back(filter);
444 return filter.get(); 443 return filter.get();
445 } 444 }
446 445
447 } // namespace content 446 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698