Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: content/browser/service_worker/service_worker_url_request_job_unittest.cc

Issue 2142523004: M52: Merge "Reland: service worker: Don't control a subframe of an insecure context" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: fix compile errors Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_url_request_job_unittest.cc
diff --git a/content/browser/service_worker/service_worker_url_request_job_unittest.cc b/content/browser/service_worker/service_worker_url_request_job_unittest.cc
index a23b6804472fb9d1cc1ce2fb9f377f725ef779f1..489a4579b017cb30480e655769d4ef3fbe09e88f 100644
--- a/content/browser/service_worker/service_worker_url_request_job_unittest.cc
+++ b/content/browser/service_worker/service_worker_url_request_job_unittest.cc
@@ -143,13 +143,9 @@ class ServiceWorkerURLRequestJobTest
helper_.reset(helper);
registration_ = new ServiceWorkerRegistration(
- GURL("http://example.com/"),
- 1L,
- helper_->context()->AsWeakPtr());
+ GURL("https://example.com/"), 1L, helper_->context()->AsWeakPtr());
version_ = new ServiceWorkerVersion(
- registration_.get(),
- GURL("http://example.com/service_worker.js"),
- 1L,
+ registration_.get(), GURL("https://example.com/service_worker.js"), 1L,
helper_->context()->AsWeakPtr());
std::vector<ServiceWorkerDatabase::ResourceRecord> records;
records.push_back(
@@ -181,10 +177,11 @@ class ServiceWorkerURLRequestJobTest
std::unique_ptr<ServiceWorkerProviderHost> provider_host(
new ServiceWorkerProviderHost(
helper_->mock_render_process_id(), MSG_ROUTING_NONE, kProviderID,
- SERVICE_WORKER_PROVIDER_FOR_WINDOW, helper_->context()->AsWeakPtr(),
- nullptr));
+ SERVICE_WORKER_PROVIDER_FOR_WINDOW,
+ ServiceWorkerProviderHost::FrameSecurityLevel::SECURE,
+ helper_->context()->AsWeakPtr(), nullptr));
provider_host_ = provider_host->AsWeakPtr();
- provider_host->SetDocumentUrl(GURL("http://example.com/"));
+ provider_host->SetDocumentUrl(GURL("https://example.com/"));
registration_->SetActiveVersion(version_);
provider_host->AssociateRegistration(registration_.get(),
false /* notify_controllerchange */);
@@ -198,7 +195,7 @@ class ServiceWorkerURLRequestJobTest
url_request_job_factory_.reset(new net::URLRequestJobFactoryImpl);
url_request_job_factory_->SetProtocolHandler(
- "http",
+ "https",
base::WrapUnique(new MockHttpProtocolHandler(
provider_host->AsWeakPtr(), browser_context_->GetResourceContext(),
blob_storage_context->AsWeakPtr(), this)));
@@ -240,7 +237,7 @@ class ServiceWorkerURLRequestJobTest
const std::string& expected_response,
bool expect_valid_ssl) {
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
@@ -376,7 +373,7 @@ TEST_F(ServiceWorkerURLRequestJobTest, DeletedProviderHostOnFetchEvent) {
TEST_F(ServiceWorkerURLRequestJobTest, DeletedProviderHostBeforeFetchEvent) {
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
@@ -518,7 +515,7 @@ TEST_F(ServiceWorkerURLRequestJobTest, StreamResponse) {
SetUpWithHelper(new StreamResponder(stream_url));
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
request_->Start();
@@ -566,7 +563,7 @@ TEST_F(ServiceWorkerURLRequestJobTest, StreamResponse_DelayedRegistration) {
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
request_->Start();
@@ -626,7 +623,7 @@ TEST_F(ServiceWorkerURLRequestJobTest, StreamResponse_QuickFinalize) {
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
request_->Start();
@@ -668,7 +665,7 @@ TEST_F(ServiceWorkerURLRequestJobTest, StreamResponse_Flush) {
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
request_->Start();
@@ -716,7 +713,7 @@ TEST_F(ServiceWorkerURLRequestJobTest, StreamResponseAndCancel) {
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
request_->Start();
@@ -766,7 +763,7 @@ TEST_F(ServiceWorkerURLRequestJobTest,
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
request_->Start();
@@ -813,7 +810,7 @@ TEST_F(ServiceWorkerURLRequestJobTest, FailFetchDispatch) {
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
request_->Start();
@@ -843,7 +840,7 @@ TEST_F(ServiceWorkerURLRequestJobTest, MainScriptHTTPResponseInfoNotSet) {
SetUpWithHelper(new EmbeddedWorkerTestHelper(base::FilePath()), false);
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
request_ = url_request_context_.CreateRequest(
- GURL("http://example.com/foo.html"), net::DEFAULT_PRIORITY,
+ GURL("https://example.com/foo.html"), net::DEFAULT_PRIORITY,
&url_request_delegate_);
request_->set_method("GET");
request_->Start();

Powered by Google App Engine
This is Rietveld 408576698