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

Side by Side Diff: content/browser/service_worker/service_worker_controllee_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 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_controllee_request_handl er.h" 5 #include "content/browser/service_worker/service_worker_controllee_request_handl er.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 net::DEFAULT_PRIORITY, 58 net::DEFAULT_PRIORITY,
59 &test->url_request_delegate_, 59 &test->url_request_delegate_,
60 TRAFFIC_ANNOTATION_FOR_TESTS)), 60 TRAFFIC_ANNOTATION_FOR_TESTS)),
61 handler_(new ServiceWorkerControlleeRequestHandler( 61 handler_(new ServiceWorkerControlleeRequestHandler(
62 test->context()->AsWeakPtr(), 62 test->context()->AsWeakPtr(),
63 test->provider_host_, 63 test->provider_host_,
64 base::WeakPtr<storage::BlobStorageContext>(), 64 base::WeakPtr<storage::BlobStorageContext>(),
65 fetch_type, 65 fetch_type,
66 FETCH_CREDENTIALS_MODE_OMIT, 66 FETCH_CREDENTIALS_MODE_OMIT,
67 FetchRedirectMode::FOLLOW_MODE, 67 FetchRedirectMode::FOLLOW_MODE,
68 std::string() /* integrity */,
68 type, 69 type,
69 REQUEST_CONTEXT_TYPE_HYPERLINK, 70 REQUEST_CONTEXT_TYPE_HYPERLINK,
70 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, 71 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL,
71 scoped_refptr<ResourceRequestBody>())), 72 scoped_refptr<ResourceRequestBody>())),
72 job_(nullptr) {} 73 job_(nullptr) {}
73 74
74 ServiceWorkerURLRequestJob* MaybeCreateJob() { 75 ServiceWorkerURLRequestJob* MaybeCreateJob() {
75 job_.reset(handler_->MaybeCreateJob(request_.get(), nullptr, 76 job_.reset(handler_->MaybeCreateJob(request_.get(), nullptr,
76 &test_->mock_resource_context_)); 77 &test_->mock_resource_context_));
77 return static_cast<ServiceWorkerURLRequestJob*>(job_.get()); 78 return static_cast<ServiceWorkerURLRequestJob*>(job_.get());
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // Empty offline header value should not cause fallback. 422 // Empty offline header value should not cause fallback.
422 test_resources.request()->SetExtraRequestHeaderByName("X-Chrome-offline", "", 423 test_resources.request()->SetExtraRequestHeaderByName("X-Chrome-offline", "",
423 true); 424 true);
424 ServiceWorkerURLRequestJob* sw_job = test_resources.MaybeCreateJob(); 425 ServiceWorkerURLRequestJob* sw_job = test_resources.MaybeCreateJob();
425 426
426 EXPECT_TRUE(sw_job); 427 EXPECT_TRUE(sw_job);
427 } 428 }
428 #endif // BUILDFLAG(ENABLE_OFFLINE_PAGE 429 #endif // BUILDFLAG(ENABLE_OFFLINE_PAGE
429 430
430 } // namespace content 431 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698