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_url_request_job.h" | 5 #include "content/browser/service_worker/service_worker_url_request_job.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 http_info.ssl_info.cert = | 188 http_info.ssl_info.cert = |
189 net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); | 189 net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); |
190 EXPECT_TRUE(http_info.ssl_info.is_valid()); | 190 EXPECT_TRUE(http_info.ssl_info.is_valid()); |
191 http_info.ssl_info.security_bits = 0x100; | 191 http_info.ssl_info.security_bits = 0x100; |
192 // SSL3 TLS_DHE_RSA_WITH_AES_256_CBC_SHA | 192 // SSL3 TLS_DHE_RSA_WITH_AES_256_CBC_SHA |
193 http_info.ssl_info.connection_status = 0x300039; | 193 http_info.ssl_info.connection_status = 0x300039; |
194 http_info.headers = make_scoped_refptr(new net::HttpResponseHeaders("")); | 194 http_info.headers = make_scoped_refptr(new net::HttpResponseHeaders("")); |
195 version_->SetMainScriptHttpResponseInfo(http_info); | 195 version_->SetMainScriptHttpResponseInfo(http_info); |
196 } | 196 } |
197 | 197 |
198 std::unique_ptr<ServiceWorkerProviderHost> provider_host( | 198 std::unique_ptr<ServiceWorkerProviderHost> provider_host = |
199 new ServiceWorkerProviderHost( | 199 CreateProviderHostForWindow( |
200 helper_->mock_render_process_id(), MSG_ROUTING_NONE, kProviderID, | 200 helper_->mock_render_process_id(), kProviderID, |
201 SERVICE_WORKER_PROVIDER_FOR_WINDOW, | 201 true /* is_parent_frame_secure */, helper_->context()->AsWeakPtr()); |
202 ServiceWorkerProviderHost::FrameSecurityLevel::SECURE, | |
203 helper_->context()->AsWeakPtr(), nullptr)); | |
204 provider_host_ = provider_host->AsWeakPtr(); | 202 provider_host_ = provider_host->AsWeakPtr(); |
205 provider_host->SetDocumentUrl(GURL("https://example.com/")); | 203 provider_host->SetDocumentUrl(GURL("https://example.com/")); |
206 registration_->SetActiveVersion(version_); | 204 registration_->SetActiveVersion(version_); |
207 provider_host->AssociateRegistration(registration_.get(), | 205 provider_host->AssociateRegistration(registration_.get(), |
208 false /* notify_controllerchange */); | 206 false /* notify_controllerchange */); |
209 | 207 |
210 ChromeBlobStorageContext* chrome_blob_storage_context = | 208 ChromeBlobStorageContext* chrome_blob_storage_context = |
211 ChromeBlobStorageContext::GetFor(browser_context_.get()); | 209 ChromeBlobStorageContext::GetFor(browser_context_.get()); |
212 // Wait for chrome_blob_storage_context to finish initializing. | 210 // Wait for chrome_blob_storage_context to finish initializing. |
213 base::RunLoop().RunUntilIdle(); | 211 base::RunLoop().RunUntilIdle(); |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 base::RunLoop().RunUntilIdle(); | 1094 base::RunLoop().RunUntilIdle(); |
1097 | 1095 |
1098 // The fetch event request should no longer be in-flight. | 1096 // The fetch event request should no longer be in-flight. |
1099 EXPECT_FALSE(version_->HasWork()); | 1097 EXPECT_FALSE(version_->HasWork()); |
1100 } | 1098 } |
1101 | 1099 |
1102 // TODO(kinuko): Add more tests with different response data and also for | 1100 // TODO(kinuko): Add more tests with different response data and also for |
1103 // FallbackToNetwork case. | 1101 // FallbackToNetwork case. |
1104 | 1102 |
1105 } // namespace content | 1103 } // namespace content |
OLD | NEW |