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

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

Issue 2941883003: [ServiceWorker] Fetch event should return integrity value (Closed)
Patch Set: Address yhirano's comment #78 Created 3 years, 5 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 std::string() /* integrity */, RESOURCE_TYPE_SERVICE_WORKER,
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
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
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_url_request_job_unittest.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698