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

Side by Side Diff: content/browser/service_worker/service_worker_write_to_cache_job_unittest.cc

Issue 2009453002: service worker: Don't control a subframe of an insecure context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments 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 unified diff | Download patch
OLDNEW
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 <utility> 8 #include <utility>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 mock_protocol_handler_(nullptr) {} 275 mock_protocol_handler_(nullptr) {}
276 ~ServiceWorkerWriteToCacheJobTest() override {} 276 ~ServiceWorkerWriteToCacheJobTest() override {}
277 277
278 void CreateHostForVersion( 278 void CreateHostForVersion(
279 int process_id, 279 int process_id,
280 int provider_id, 280 int provider_id,
281 const scoped_refptr<ServiceWorkerVersion>& version) { 281 const scoped_refptr<ServiceWorkerVersion>& version) {
282 std::unique_ptr<ServiceWorkerProviderHost> host( 282 std::unique_ptr<ServiceWorkerProviderHost> host(
283 new ServiceWorkerProviderHost(process_id, MSG_ROUTING_NONE, provider_id, 283 new ServiceWorkerProviderHost(process_id, MSG_ROUTING_NONE, provider_id,
284 SERVICE_WORKER_PROVIDER_FOR_WORKER, 284 SERVICE_WORKER_PROVIDER_FOR_WORKER,
285 true /* is_parent_frame_secure */,
285 context()->AsWeakPtr(), nullptr)); 286 context()->AsWeakPtr(), nullptr));
286 base::WeakPtr<ServiceWorkerProviderHost> provider_host = host->AsWeakPtr(); 287 base::WeakPtr<ServiceWorkerProviderHost> provider_host = host->AsWeakPtr();
287 context()->AddProviderHost(std::move(host)); 288 context()->AddProviderHost(std::move(host));
288 provider_host->running_hosted_version_ = version; 289 provider_host->running_hosted_version_ = version;
289 } 290 }
290 291
291 void SetUpScriptRequest(int process_id, int provider_id) { 292 void SetUpScriptRequest(int process_id, int provider_id) {
292 request_.reset(); 293 request_.reset();
293 url_request_context_.reset(); 294 url_request_context_.reset();
294 url_request_job_factory_.reset(); 295 url_request_job_factory_.reset();
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 mock_protocol_handler_->SetCreateJobCallback( 609 mock_protocol_handler_->SetCreateJobCallback(
609 base::Bind(&CreateNormalURLRequestJob)); 610 base::Bind(&CreateNormalURLRequestJob));
610 DisableCache(); 611 DisableCache();
611 request_->Start(); 612 request_->Start();
612 base::RunLoop().RunUntilIdle(); 613 base::RunLoop().RunUntilIdle();
613 EXPECT_EQ(net::URLRequestStatus::FAILED, request_->status().status()); 614 EXPECT_EQ(net::URLRequestStatus::FAILED, request_->status().status());
614 EXPECT_EQ(net::ERR_FAILED, request_->status().error()); 615 EXPECT_EQ(net::ERR_FAILED, request_->status().error());
615 } 616 }
616 617
617 } // namespace content 618 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698