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 "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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 net::DEFAULT_PRIORITY, | 57 net::DEFAULT_PRIORITY, |
58 &test->url_request_delegate_, | 58 &test->url_request_delegate_, |
59 TRAFFIC_ANNOTATION_FOR_TESTS)), | 59 TRAFFIC_ANNOTATION_FOR_TESTS)), |
60 handler_(new ServiceWorkerControlleeRequestHandler( | 60 handler_(new ServiceWorkerControlleeRequestHandler( |
61 test->context()->AsWeakPtr(), | 61 test->context()->AsWeakPtr(), |
62 test->provider_host_, | 62 test->provider_host_, |
63 base::WeakPtr<storage::BlobStorageContext>(), | 63 base::WeakPtr<storage::BlobStorageContext>(), |
64 fetch_type, | 64 fetch_type, |
65 FETCH_CREDENTIALS_MODE_OMIT, | 65 FETCH_CREDENTIALS_MODE_OMIT, |
66 FetchRedirectMode::FOLLOW_MODE, | 66 FetchRedirectMode::FOLLOW_MODE, |
67 "" /*integrity*/, | |
falken
2017/07/07 00:56:10
ditto
xiaofengzhang
2017/07/12 09:13:52
Done.
| |
67 type, | 68 type, |
68 REQUEST_CONTEXT_TYPE_HYPERLINK, | 69 REQUEST_CONTEXT_TYPE_HYPERLINK, |
69 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, | 70 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, |
70 scoped_refptr<ResourceRequestBody>())), | 71 scoped_refptr<ResourceRequestBody>())), |
71 job_(nullptr) {} | 72 job_(nullptr) {} |
72 | 73 |
73 ServiceWorkerURLRequestJob* MaybeCreateJob() { | 74 ServiceWorkerURLRequestJob* MaybeCreateJob() { |
74 job_.reset(handler_->MaybeCreateJob(request_.get(), nullptr, | 75 job_.reset(handler_->MaybeCreateJob(request_.get(), nullptr, |
75 &test_->mock_resource_context_)); | 76 &test_->mock_resource_context_)); |
76 return static_cast<ServiceWorkerURLRequestJob*>(job_.get()); | 77 return static_cast<ServiceWorkerURLRequestJob*>(job_.get()); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
372 EXPECT_FALSE(sub_cors_job->ShouldFallbackToNetwork()); | 373 EXPECT_FALSE(sub_cors_job->ShouldFallbackToNetwork()); |
373 EXPECT_FALSE(sub_cors_job->ShouldForwardToServiceWorker()); | 374 EXPECT_FALSE(sub_cors_job->ShouldForwardToServiceWorker()); |
374 | 375 |
375 base::RunLoop().RunUntilIdle(); | 376 base::RunLoop().RunUntilIdle(); |
376 | 377 |
377 EXPECT_FALSE(sub_cors_job->ShouldFallbackToNetwork()); | 378 EXPECT_FALSE(sub_cors_job->ShouldFallbackToNetwork()); |
378 EXPECT_FALSE(sub_cors_job->ShouldForwardToServiceWorker()); | 379 EXPECT_FALSE(sub_cors_job->ShouldForwardToServiceWorker()); |
379 } | 380 } |
380 | 381 |
381 } // namespace content | 382 } // namespace content |
OLD | NEW |