Chromium Code Reviews| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 "https", base::WrapUnique(mock_protocol_handler_)); | 315 "https", base::WrapUnique(mock_protocol_handler_)); |
| 316 url_request_context_->set_job_factory(url_request_job_factory_.get()); | 316 url_request_context_->set_job_factory(url_request_job_factory_.get()); |
| 317 | 317 |
| 318 request_ = url_request_context_->CreateRequest( | 318 request_ = url_request_context_->CreateRequest( |
| 319 script_url_, net::DEFAULT_PRIORITY, &url_request_delegate_, | 319 script_url_, net::DEFAULT_PRIORITY, &url_request_delegate_, |
| 320 TRAFFIC_ANNOTATION_FOR_TESTS); | 320 TRAFFIC_ANNOTATION_FOR_TESTS); |
| 321 ServiceWorkerRequestHandler::InitializeHandler( | 321 ServiceWorkerRequestHandler::InitializeHandler( |
| 322 request_.get(), context_wrapper(), &blob_storage_context_, process_id, | 322 request_.get(), context_wrapper(), &blob_storage_context_, process_id, |
| 323 provider_id, false, FETCH_REQUEST_MODE_NO_CORS, | 323 provider_id, false, FETCH_REQUEST_MODE_NO_CORS, |
| 324 FETCH_CREDENTIALS_MODE_OMIT, FetchRedirectMode::FOLLOW_MODE, | 324 FETCH_CREDENTIALS_MODE_OMIT, FetchRedirectMode::FOLLOW_MODE, |
| 325 RESOURCE_TYPE_SERVICE_WORKER, REQUEST_CONTEXT_TYPE_SERVICE_WORKER, | 325 "" /*integrity*/, RESOURCE_TYPE_SERVICE_WORKER, |
|
xiaofengzhang
2017/07/12 09:13:52
replacement done
| |
| 326 REQUEST_CONTEXT_FRAME_TYPE_NONE, scoped_refptr<ResourceRequestBody>()); | 326 REQUEST_CONTEXT_TYPE_SERVICE_WORKER, REQUEST_CONTEXT_FRAME_TYPE_NONE, |
| 327 scoped_refptr<ResourceRequestBody>()); | |
| 327 } | 328 } |
| 328 | 329 |
| 329 int NextProviderId() { return next_provider_id_++; } | 330 int NextProviderId() { return next_provider_id_++; } |
| 330 int NextVersionId() { return next_version_id_++; } | 331 int NextVersionId() { return next_version_id_++; } |
| 331 | 332 |
| 332 void SetUp() override { | 333 void SetUp() override { |
| 333 int provider_id = NextProviderId(); | 334 int provider_id = NextProviderId(); |
| 334 helper_.reset(new EmbeddedWorkerTestHelper(base::FilePath())); | 335 helper_.reset(new EmbeddedWorkerTestHelper(base::FilePath())); |
| 335 | 336 |
| 336 // A new unstored registration/version. | 337 // A new unstored registration/version. |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 682 mock_protocol_handler_->SetCreateJobCallback( | 683 mock_protocol_handler_->SetCreateJobCallback( |
| 683 base::Bind(&CreateNormalURLRequestJob)); | 684 base::Bind(&CreateNormalURLRequestJob)); |
| 684 DisableCache(); | 685 DisableCache(); |
| 685 request_->Start(); | 686 request_->Start(); |
| 686 base::RunLoop().RunUntilIdle(); | 687 base::RunLoop().RunUntilIdle(); |
| 687 EXPECT_EQ(net::URLRequestStatus::FAILED, request_->status().status()); | 688 EXPECT_EQ(net::URLRequestStatus::FAILED, request_->status().status()); |
| 688 EXPECT_EQ(net::ERR_FAILED, request_->status().error()); | 689 EXPECT_EQ(net::ERR_FAILED, request_->status().error()); |
| 689 } | 690 } |
| 690 | 691 |
| 691 } // namespace content | 692 } // namespace content |
| OLD | NEW |