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 "base/location.h" | 5 #include "base/location.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "content/browser/fileapi/mock_url_request_delegate.h" | 9 #include "content/browser/fileapi/mock_url_request_delegate.h" |
10 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 10 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 url_request_job_factory_.reset(new net::URLRequestJobFactoryImpl); | 282 url_request_job_factory_.reset(new net::URLRequestJobFactoryImpl); |
283 url_request_job_factory_->SetProtocolHandler("https", | 283 url_request_job_factory_->SetProtocolHandler("https", |
284 mock_protocol_handler_); | 284 mock_protocol_handler_); |
285 url_request_context_->set_job_factory(url_request_job_factory_.get()); | 285 url_request_context_->set_job_factory(url_request_job_factory_.get()); |
286 | 286 |
287 request_ = url_request_context_->CreateRequest( | 287 request_ = url_request_context_->CreateRequest( |
288 script_url_, net::DEFAULT_PRIORITY, &url_request_delegate_); | 288 script_url_, net::DEFAULT_PRIORITY, &url_request_delegate_); |
289 ServiceWorkerRequestHandler::InitializeHandler( | 289 ServiceWorkerRequestHandler::InitializeHandler( |
290 request_.get(), context_wrapper(), &blob_storage_context_, process_id, | 290 request_.get(), context_wrapper(), &blob_storage_context_, process_id, |
291 provider_id, false, FETCH_REQUEST_MODE_NO_CORS, | 291 provider_id, false, FETCH_REQUEST_MODE_NO_CORS, |
292 FETCH_CREDENTIALS_MODE_OMIT, RESOURCE_TYPE_SERVICE_WORKER, | 292 FETCH_CREDENTIALS_MODE_OMIT, FetchRedirectMode::FOLLOW_MODE, |
293 REQUEST_CONTEXT_TYPE_SERVICE_WORKER, REQUEST_CONTEXT_FRAME_TYPE_NONE, | 293 RESOURCE_TYPE_SERVICE_WORKER, REQUEST_CONTEXT_TYPE_SERVICE_WORKER, |
294 scoped_refptr<ResourceRequestBody>()); | 294 REQUEST_CONTEXT_FRAME_TYPE_NONE, scoped_refptr<ResourceRequestBody>()); |
295 } | 295 } |
296 | 296 |
297 int NextRenderProcessId() { return next_render_process_id_++; } | 297 int NextRenderProcessId() { return next_render_process_id_++; } |
298 int NextProviderId() { return next_provider_id_++; } | 298 int NextProviderId() { return next_provider_id_++; } |
299 int NextVersionId() { return next_version_id_++; } | 299 int NextVersionId() { return next_version_id_++; } |
300 | 300 |
301 void SetUp() override { | 301 void SetUp() override { |
302 int render_process_id = NextRenderProcessId(); | 302 int render_process_id = NextRenderProcessId(); |
303 int provider_id = NextProviderId(); | 303 int provider_id = NextProviderId(); |
304 helper_.reset( | 304 helper_.reset( |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 version = UpdateScript(std::string()); | 567 version = UpdateScript(std::string()); |
568 VerifyResource(GetResourceId(version.get()), std::string()); | 568 VerifyResource(GetResourceId(version.get()), std::string()); |
569 registration_->SetWaitingVersion(version); | 569 registration_->SetWaitingVersion(version); |
570 | 570 |
571 // Update from empty to empty. | 571 // Update from empty to empty. |
572 version = UpdateScript(std::string()); | 572 version = UpdateScript(std::string()); |
573 EXPECT_EQ(kInvalidServiceWorkerResponseId, GetResourceId(version.get())); | 573 EXPECT_EQ(kInvalidServiceWorkerResponseId, GetResourceId(version.get())); |
574 } | 574 } |
575 | 575 |
576 } // namespace content | 576 } // namespace content |
OLD | NEW |