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

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

Issue 2941883003: [ServiceWorker] Fetch event should return integrity value (Closed)
Patch Set: Rebase 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 "content/browser/service_worker/service_worker_url_request_job.h" 5 #include "content/browser/service_worker/service_worker_url_request_job.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // Simulate fallback to network by constructing a valid response. 102 // Simulate fallback to network by constructing a valid response.
103 return new net::URLRequestTestJob(request, network_delegate, 103 return new net::URLRequestTestJob(request, network_delegate,
104 net::URLRequestTestJob::test_headers(), 104 net::URLRequestTestJob::test_headers(),
105 "PASS", true); 105 "PASS", true);
106 } 106 }
107 107
108 job_ = new ServiceWorkerURLRequestJob( 108 job_ = new ServiceWorkerURLRequestJob(
109 request, network_delegate, provider_host_->client_uuid(), 109 request, network_delegate, provider_host_->client_uuid(),
110 blob_storage_context_, resource_context_, FETCH_REQUEST_MODE_NO_CORS, 110 blob_storage_context_, resource_context_, FETCH_REQUEST_MODE_NO_CORS,
111 FETCH_CREDENTIALS_MODE_OMIT, FetchRedirectMode::FOLLOW_MODE, 111 FETCH_CREDENTIALS_MODE_OMIT, FetchRedirectMode::FOLLOW_MODE,
112 resource_type_, REQUEST_CONTEXT_TYPE_HYPERLINK, 112 "" /*integrity*/, resource_type_, REQUEST_CONTEXT_TYPE_HYPERLINK,
falken 2017/07/07 00:56:11 ditto (I'll stop saying ditto now)
xiaofengzhang 2017/07/12 09:13:52 Done. Thanks a lot falken!
113 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, 113 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL,
114 scoped_refptr<ResourceRequestBody>(), ServiceWorkerFetchType::FETCH, 114 scoped_refptr<ResourceRequestBody>(), ServiceWorkerFetchType::FETCH,
115 custom_timeout_, delegate_); 115 custom_timeout_, delegate_);
116 if (simulate_navigation_preload_) { 116 if (simulate_navigation_preload_) {
117 job_->set_simulate_navigation_preload_for_test(); 117 job_->set_simulate_navigation_preload_for_test();
118 } 118 }
119 job_->ForwardToServiceWorker(); 119 job_->ForwardToServiceWorker();
120 return job_; 120 return job_;
121 } 121 }
122 ServiceWorkerURLRequestJob* job() { return job_; } 122 ServiceWorkerURLRequestJob* job() { return job_; }
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 base::RunLoop().RunUntilIdle(); 1425 base::RunLoop().RunUntilIdle();
1426 1426
1427 // The fetch event request should no longer be in-flight. 1427 // The fetch event request should no longer be in-flight.
1428 EXPECT_FALSE(version_->HasWork()); 1428 EXPECT_FALSE(version_->HasWork());
1429 } 1429 }
1430 1430
1431 // TODO(kinuko): Add more tests with different response data and also for 1431 // TODO(kinuko): Add more tests with different response data and also for
1432 // FallbackToNetwork case. 1432 // FallbackToNetwork case.
1433 1433
1434 } // namespace content 1434 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698