| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/background_fetch/background_fetch_test_base.h" | 5 #include "content/browser/background_fetch/background_fetch_test_base.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 DCHECK(registration_id); | 233 DCHECK(registration_id); |
| 234 DCHECK(registration_id->is_null()); | 234 DCHECK(registration_id->is_null()); |
| 235 | 235 |
| 236 GURL script_url(kTestScriptUrl); | 236 GURL script_url(kTestScriptUrl); |
| 237 | 237 |
| 238 int64_t service_worker_registration_id = kInvalidServiceWorkerRegistrationId; | 238 int64_t service_worker_registration_id = kInvalidServiceWorkerRegistrationId; |
| 239 | 239 |
| 240 { | 240 { |
| 241 base::RunLoop run_loop; | 241 base::RunLoop run_loop; |
| 242 embedded_worker_test_helper_.context()->RegisterServiceWorker( | 242 embedded_worker_test_helper_.context()->RegisterServiceWorker( |
| 243 origin_.GetURL(), script_url, nullptr /* provider_host */, | 243 script_url, ServiceWorkerRegistrationOptions(origin_.GetURL()), |
| 244 nullptr /* provider_host */, |
| 244 base::Bind(&DidRegisterServiceWorker, &service_worker_registration_id, | 245 base::Bind(&DidRegisterServiceWorker, &service_worker_registration_id, |
| 245 run_loop.QuitClosure())); | 246 run_loop.QuitClosure())); |
| 246 | 247 |
| 247 run_loop.Run(); | 248 run_loop.Run(); |
| 248 } | 249 } |
| 249 | 250 |
| 250 if (service_worker_registration_id == kInvalidServiceWorkerRegistrationId) { | 251 if (service_worker_registration_id == kInvalidServiceWorkerRegistrationId) { |
| 251 ADD_FAILURE() << "Could not obtain a valid Service Worker registration"; | 252 ADD_FAILURE() << "Could not obtain a valid Service Worker registration"; |
| 252 return false; | 253 return false; |
| 253 } | 254 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 // Create a ServiceWorkerFetchRequest request with the same information. | 294 // Create a ServiceWorkerFetchRequest request with the same information. |
| 294 return ServiceWorkerFetchRequest(gurl, method, ServiceWorkerHeaderMap(), | 295 return ServiceWorkerFetchRequest(gurl, method, ServiceWorkerHeaderMap(), |
| 295 Referrer(), false /* is_reload */); | 296 Referrer(), false /* is_reload */); |
| 296 } | 297 } |
| 297 | 298 |
| 298 MockDownloadManager* BackgroundFetchTestBase::download_manager() { | 299 MockDownloadManager* BackgroundFetchTestBase::download_manager() { |
| 299 return download_manager_; | 300 return download_manager_; |
| 300 } | 301 } |
| 301 | 302 |
| 302 } // namespace content | 303 } // namespace content |
| OLD | NEW |