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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 *result = fetch_result.result; | 634 *result = fetch_result.result; |
635 *response = fetch_result.response; | 635 *response = fetch_result.response; |
636 *blob_data_handle = std::move(fetch_result.blob_data_handle); | 636 *blob_data_handle = std::move(fetch_result.blob_data_handle); |
637 ASSERT_EQ(SERVICE_WORKER_OK, fetch_result.status); | 637 ASSERT_EQ(SERVICE_WORKER_OK, fetch_result.status); |
638 } | 638 } |
639 | 639 |
640 void SetUpRegistrationOnIOThread(const std::string& worker_url) { | 640 void SetUpRegistrationOnIOThread(const std::string& worker_url) { |
641 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 641 ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
642 const GURL pattern = embedded_test_server()->GetURL("/service_worker/"); | 642 const GURL pattern = embedded_test_server()->GetURL("/service_worker/"); |
643 registration_ = new ServiceWorkerRegistration( | 643 registration_ = new ServiceWorkerRegistration( |
644 pattern, | 644 ServiceWorkerRegistrationOptions(pattern), |
645 wrapper()->context()->storage()->NewRegistrationId(), | 645 wrapper()->context()->storage()->NewRegistrationId(), |
646 wrapper()->context()->AsWeakPtr()); | 646 wrapper()->context()->AsWeakPtr()); |
647 // Set the update check time to avoid triggering updates in the middle of | 647 // Set the update check time to avoid triggering updates in the middle of |
648 // tests. | 648 // tests. |
649 registration_->set_last_update_check(base::Time::Now()); | 649 registration_->set_last_update_check(base::Time::Now()); |
650 | 650 |
651 version_ = new ServiceWorkerVersion( | 651 version_ = new ServiceWorkerVersion( |
652 registration_.get(), | 652 registration_.get(), |
653 embedded_test_server()->GetURL(worker_url), | 653 embedded_test_server()->GetURL(worker_url), |
654 wrapper()->context()->storage()->NewVersionId(), | 654 wrapper()->context()->storage()->NewVersionId(), |
(...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2965 IN_PROC_BROWSER_TEST_F(ServiceWorkerDisableWebSecurityTest, UpdateNoCrash) { | 2965 IN_PROC_BROWSER_TEST_F(ServiceWorkerDisableWebSecurityTest, UpdateNoCrash) { |
2966 StartServerAndNavigateToSetup(); | 2966 StartServerAndNavigateToSetup(); |
2967 const char kPageUrl[] = "/service_worker/disable_web_security_update.html"; | 2967 const char kPageUrl[] = "/service_worker/disable_web_security_update.html"; |
2968 const char kScopeUrl[] = "/service_worker/scope/"; | 2968 const char kScopeUrl[] = "/service_worker/scope/"; |
2969 const char kWorkerUrl[] = "/service_worker/fetch_event_blob.js"; | 2969 const char kWorkerUrl[] = "/service_worker/fetch_event_blob.js"; |
2970 RegisterServiceWorkerOnCrossOriginServer(kScopeUrl, kWorkerUrl); | 2970 RegisterServiceWorkerOnCrossOriginServer(kScopeUrl, kWorkerUrl); |
2971 RunTestWithCrossOriginURL(kPageUrl, kScopeUrl); | 2971 RunTestWithCrossOriginURL(kPageUrl, kScopeUrl); |
2972 } | 2972 } |
2973 | 2973 |
2974 } // namespace content | 2974 } // namespace content |
OLD | NEW |