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 #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 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 140 } |
141 | 141 |
142 void EmbeddedWorkerTestHelper::OnFetchEvent( | 142 void EmbeddedWorkerTestHelper::OnFetchEvent( |
143 int embedded_worker_id, | 143 int embedded_worker_id, |
144 int request_id, | 144 int request_id, |
145 const ServiceWorkerFetchRequest& request) { | 145 const ServiceWorkerFetchRequest& request) { |
146 SimulateSend(new ServiceWorkerHostMsg_FetchEventFinished( | 146 SimulateSend(new ServiceWorkerHostMsg_FetchEventFinished( |
147 embedded_worker_id, | 147 embedded_worker_id, |
148 request_id, | 148 request_id, |
149 SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE, | 149 SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE, |
150 ServiceWorkerResponse( | 150 ServiceWorkerResponse(GURL(""), |
151 GURL(""), 200, "OK", ServiceWorkerHeaderMap(), std::string()))); | 151 200, |
| 152 "OK", |
| 153 blink::WebServiceWorkerResponseTypeDefault, |
| 154 ServiceWorkerHeaderMap(), |
| 155 std::string()))); |
152 } | 156 } |
153 | 157 |
154 void EmbeddedWorkerTestHelper::SimulatePausedAfterDownload( | 158 void EmbeddedWorkerTestHelper::SimulatePausedAfterDownload( |
155 int embedded_worker_id) { | 159 int embedded_worker_id) { |
156 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); | 160 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); |
157 ASSERT_TRUE(worker != NULL); | 161 ASSERT_TRUE(worker != NULL); |
158 registry()->OnPausedAfterDownload(worker->process_id(), embedded_worker_id); | 162 registry()->OnPausedAfterDownload(worker->process_id(), embedded_worker_id); |
159 } | 163 } |
160 | 164 |
161 void EmbeddedWorkerTestHelper::SimulateWorkerReadyForInspection( | 165 void EmbeddedWorkerTestHelper::SimulateWorkerReadyForInspection( |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 request_id, | 286 request_id, |
283 request)); | 287 request)); |
284 } | 288 } |
285 | 289 |
286 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() { | 290 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() { |
287 DCHECK(context()); | 291 DCHECK(context()); |
288 return context()->embedded_worker_registry(); | 292 return context()->embedded_worker_registry(); |
289 } | 293 } |
290 | 294 |
291 } // namespace content | 295 } // namespace content |
OLD | NEW |