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

Side by Side Diff: content/browser/service_worker/foreign_fetch_request_handler_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/foreign_fetch_request_handler.h" 5 #include "content/browser/service_worker/foreign_fetch_request_handler.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/test/simple_test_tick_clock.h" 9 #include "base/test/simple_test_tick_clock.h"
10 #include "content/browser/browser_thread_impl.h" 10 #include "content/browser/browser_thread_impl.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 request_ = url_request_context_.CreateRequest( 143 request_ = url_request_context_.CreateRequest(
144 GURL(url), net::DEFAULT_PRIORITY, &url_request_delegate_, 144 GURL(url), net::DEFAULT_PRIORITY, &url_request_delegate_,
145 TRAFFIC_ANNOTATION_FOR_TESTS); 145 TRAFFIC_ANNOTATION_FOR_TESTS);
146 if (initiator) 146 if (initiator)
147 request_->set_initiator(url::Origin(GURL(initiator))); 147 request_->set_initiator(url::Origin(GURL(initiator)));
148 ForeignFetchRequestHandler::InitializeHandler( 148 ForeignFetchRequestHandler::InitializeHandler(
149 request_.get(), context_wrapper(), &blob_storage_context_, 149 request_.get(), context_wrapper(), &blob_storage_context_,
150 helper_->mock_render_process_id(), provider_host()->provider_id(), 150 helper_->mock_render_process_id(), provider_host()->provider_id(),
151 ServiceWorkerMode::ALL, FETCH_REQUEST_MODE_CORS, 151 ServiceWorkerMode::ALL, FETCH_REQUEST_MODE_CORS,
152 FETCH_CREDENTIALS_MODE_OMIT, FetchRedirectMode::FOLLOW_MODE, 152 FETCH_CREDENTIALS_MODE_OMIT, FetchRedirectMode::FOLLOW_MODE,
153 resource_type, REQUEST_CONTEXT_TYPE_FETCH, 153 std::string() /* integrity */, resource_type,
154 REQUEST_CONTEXT_FRAME_TYPE_NONE, nullptr, 154 REQUEST_CONTEXT_TYPE_FETCH, REQUEST_CONTEXT_FRAME_TYPE_NONE, nullptr,
155 true /* initiated_in_secure_context */); 155 true /* initiated_in_secure_context */);
156 156
157 return ForeignFetchRequestHandler::GetHandler(request_.get()); 157 return ForeignFetchRequestHandler::GetHandler(request_.get());
158 } 158 }
159 159
160 void CreateWindowTypeProviderHost() { 160 void CreateWindowTypeProviderHost() {
161 remote_endpoints_.emplace_back(); 161 remote_endpoints_.emplace_back();
162 std::unique_ptr<ServiceWorkerProviderHost> host = 162 std::unique_ptr<ServiceWorkerProviderHost> host =
163 CreateProviderHostForWindow( 163 CreateProviderHostForWindow(
164 helper_->mock_render_process_id(), kMockProviderId, 164 helper_->mock_render_process_id(), kMockProviderId,
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // Make sure new request only gets remaining timeout. 386 // Make sure new request only gets remaining timeout.
387 ForeignFetchRequestHandler* handler = 387 ForeignFetchRequestHandler* handler =
388 InitializeHandler("https://valid.example.com/foo", RESOURCE_TYPE_IMAGE, 388 InitializeHandler("https://valid.example.com/foo", RESOURCE_TYPE_IMAGE,
389 nullptr /* initiator */); 389 nullptr /* initiator */);
390 ASSERT_TRUE(handler); 390 ASSERT_TRUE(handler);
391 ASSERT_TRUE(timeout_for_request(handler).has_value()); 391 ASSERT_TRUE(timeout_for_request(handler).has_value());
392 EXPECT_EQ(remaining_time, timeout_for_request(handler).value()); 392 EXPECT_EQ(remaining_time, timeout_for_request(handler).value());
393 } 393 }
394 394
395 } // namespace content 395 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698