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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |