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/service_worker_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <tuple> | 8 #include <tuple> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 helper_->context()->AsWeakPtr()); | 222 helper_->context()->AsWeakPtr()); |
223 version_ = new ServiceWorkerVersion( | 223 version_ = new ServiceWorkerVersion( |
224 registration_.get(), | 224 registration_.get(), |
225 GURL("http://www.example.com/test/service_worker.js"), | 225 GURL("http://www.example.com/test/service_worker.js"), |
226 helper_->context()->storage()->NewVersionId(), | 226 helper_->context()->storage()->NewVersionId(), |
227 helper_->context()->AsWeakPtr()); | 227 helper_->context()->AsWeakPtr()); |
228 std::vector<ServiceWorkerDatabase::ResourceRecord> records; | 228 std::vector<ServiceWorkerDatabase::ResourceRecord> records; |
229 records.push_back( | 229 records.push_back( |
230 ServiceWorkerDatabase::ResourceRecord(10, version_->script_url(), 100)); | 230 ServiceWorkerDatabase::ResourceRecord(10, version_->script_url(), 100)); |
231 version_->script_cache_map()->SetResources(records); | 231 version_->script_cache_map()->SetResources(records); |
| 232 version_->SetMainScriptHttpResponseInfo( |
| 233 EmbeddedWorkerTestHelper::CreateHttpResponseInfo()); |
232 version_->set_fetch_handler_existence( | 234 version_->set_fetch_handler_existence( |
233 ServiceWorkerVersion::FetchHandlerExistence::EXISTS); | 235 ServiceWorkerVersion::FetchHandlerExistence::EXISTS); |
234 | 236 |
235 // Make the registration findable via storage functions. | 237 // Make the registration findable via storage functions. |
236 ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; | 238 ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; |
237 helper_->context()->storage()->StoreRegistration( | 239 helper_->context()->storage()->StoreRegistration( |
238 registration_.get(), | 240 registration_.get(), |
239 version_.get(), | 241 version_.get(), |
240 CreateReceiverOnCurrentThread(&status)); | 242 CreateReceiverOnCurrentThread(&status)); |
241 base::RunLoop().RunUntilIdle(); | 243 base::RunLoop().RunUntilIdle(); |
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1782 INSTANTIATE_TEST_CASE_P(ServiceWorkerFailToStartTest, | 1784 INSTANTIATE_TEST_CASE_P(ServiceWorkerFailToStartTest, |
1783 ServiceWorkerFailToStartTest, | 1785 ServiceWorkerFailToStartTest, |
1784 testing::Bool()); | 1786 testing::Bool()); |
1785 INSTANTIATE_TEST_CASE_P(ServiceWorkerNavigationHintUMATest, | 1787 INSTANTIATE_TEST_CASE_P(ServiceWorkerNavigationHintUMATest, |
1786 ServiceWorkerNavigationHintUMATest, | 1788 ServiceWorkerNavigationHintUMATest, |
1787 testing::Bool()); | 1789 testing::Bool()); |
1788 INSTANTIATE_TEST_CASE_P(ServiceWorkerStallInStoppingTest, | 1790 INSTANTIATE_TEST_CASE_P(ServiceWorkerStallInStoppingTest, |
1789 ServiceWorkerStallInStoppingTest, | 1791 ServiceWorkerStallInStoppingTest, |
1790 testing::Bool()); | 1792 testing::Bool()); |
1791 } // namespace content | 1793 } // namespace content |
OLD | NEW |