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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(GURL(""), | 150 ServiceWorkerResponse(GURL(""), |
151 200, | 151 200, |
152 "OK", | 152 "OK", |
153 blink::WebServiceWorkerResponseTypeDefault, | 153 blink::WebServiceWorkerResponseTypeDefault, |
154 ServiceWorkerHeaderMap(), | 154 ServiceWorkerHeaderMap(), |
155 std::string()))); | 155 std::string(), |
| 156 0))); |
156 } | 157 } |
157 | 158 |
158 void EmbeddedWorkerTestHelper::SimulatePausedAfterDownload( | 159 void EmbeddedWorkerTestHelper::SimulatePausedAfterDownload( |
159 int embedded_worker_id) { | 160 int embedded_worker_id) { |
160 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); | 161 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); |
161 ASSERT_TRUE(worker != NULL); | 162 ASSERT_TRUE(worker != NULL); |
162 registry()->OnPausedAfterDownload(worker->process_id(), embedded_worker_id); | 163 registry()->OnPausedAfterDownload(worker->process_id(), embedded_worker_id); |
163 } | 164 } |
164 | 165 |
165 void EmbeddedWorkerTestHelper::SimulateWorkerReadyForInspection( | 166 void EmbeddedWorkerTestHelper::SimulateWorkerReadyForInspection( |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 request_id, | 287 request_id, |
287 request)); | 288 request)); |
288 } | 289 } |
289 | 290 |
290 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() { | 291 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() { |
291 DCHECK(context()); | 292 DCHECK(context()); |
292 return context()->embedded_worker_registry(); | 293 return context()->embedded_worker_registry(); |
293 } | 294 } |
294 | 295 |
295 } // namespace content | 296 } // namespace content |
OLD | NEW |