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

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

Issue 2061203002: WIP Reland: service worker: Don't control a subframe of an insecure context Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: maybe fix drmemory Created 4 years, 6 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 8da106c402db6777d6391fe4ca1caf1a18b90c61..53b3fe81ebbb3d406e152ff473eb55628dd15843 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");
@@ -377,7 +374,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");
@@ -521,7 +518,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();
@@ -569,7 +566,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();
@@ -629,7 +626,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();
@@ -671,7 +668,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();
@@ -719,7 +716,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();
@@ -769,7 +766,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();
@@ -816,7 +813,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();
@@ -846,7 +843,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