OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_data_pipe_reader.h" | 5 #include "content/browser/service_worker/service_worker_data_pipe_reader.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 8 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
9 #include "content/browser/service_worker/service_worker_context_core.h" | 9 #include "content/browser/service_worker/service_worker_context_core.h" |
10 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 explicit MockServiceWorkerURLRequestJob( | 29 explicit MockServiceWorkerURLRequestJob( |
30 ServiceWorkerURLRequestJob::Delegate* delegate) | 30 ServiceWorkerURLRequestJob::Delegate* delegate) |
31 : ServiceWorkerURLRequestJob(nullptr, | 31 : ServiceWorkerURLRequestJob(nullptr, |
32 nullptr, | 32 nullptr, |
33 "", | 33 "", |
34 nullptr, | 34 nullptr, |
35 nullptr, | 35 nullptr, |
36 FETCH_REQUEST_MODE_NO_CORS, | 36 FETCH_REQUEST_MODE_NO_CORS, |
37 FETCH_CREDENTIALS_MODE_OMIT, | 37 FETCH_CREDENTIALS_MODE_OMIT, |
38 FetchRedirectMode::FOLLOW_MODE, | 38 FetchRedirectMode::FOLLOW_MODE, |
| 39 std::string() /* integrity */, |
39 RESOURCE_TYPE_MAIN_FRAME, | 40 RESOURCE_TYPE_MAIN_FRAME, |
40 REQUEST_CONTEXT_TYPE_HYPERLINK, | 41 REQUEST_CONTEXT_TYPE_HYPERLINK, |
41 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, | 42 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL, |
42 scoped_refptr<ResourceRequestBody>(), | 43 scoped_refptr<ResourceRequestBody>(), |
43 ServiceWorkerFetchType::FETCH, | 44 ServiceWorkerFetchType::FETCH, |
44 base::Optional<base::TimeDelta>(), | 45 base::Optional<base::TimeDelta>(), |
45 delegate), | 46 delegate), |
46 is_response_started_(false) {} | 47 is_response_started_(false) {} |
47 | 48 |
48 void OnResponseStarted() override { is_response_started_ = true; } | 49 void OnResponseStarted() override { is_response_started_ = true; } |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 ASSERT_EQ(1UL, mock_url_request_job()->results().size()); | 408 ASSERT_EQ(1UL, mock_url_request_job()->results().size()); |
408 EXPECT_EQ(ServiceWorkerMetrics::REQUEST_JOB_ERROR_STREAM_ABORTED, | 409 EXPECT_EQ(ServiceWorkerMetrics::REQUEST_JOB_ERROR_STREAM_ABORTED, |
409 mock_url_request_job()->results()[0]); | 410 mock_url_request_job()->results()[0]); |
410 } | 411 } |
411 | 412 |
412 INSTANTIATE_TEST_CASE_P(ServiceWorkerDataPipeReaderTest, | 413 INSTANTIATE_TEST_CASE_P(ServiceWorkerDataPipeReaderTest, |
413 ServiceWorkerDataPipeReaderTestP, | 414 ServiceWorkerDataPipeReaderTestP, |
414 testing::Combine(testing::Bool(), testing::Bool())); | 415 testing::Combine(testing::Bool(), testing::Bool())); |
415 | 416 |
416 } // namespace content | 417 } // namespace content |
OLD | NEW |