| OLD | NEW |
| 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" |
| 11 #include "content/browser/fileapi/mock_url_request_delegate.h" | |
| 12 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 11 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
| 13 #include "content/browser/service_worker/service_worker_context_core.h" | 12 #include "content/browser/service_worker/service_worker_context_core.h" |
| 14 #include "content/browser/service_worker/service_worker_registration.h" | 13 #include "content/browser/service_worker/service_worker_registration.h" |
| 15 #include "content/browser/service_worker/service_worker_test_utils.h" | 14 #include "content/browser/service_worker/service_worker_test_utils.h" |
| 16 #include "content/browser/service_worker/service_worker_version.h" | 15 #include "content/browser/service_worker/service_worker_version.h" |
| 17 #include "content/common/service_worker/service_worker_utils.h" | 16 #include "content/common/service_worker/service_worker_utils.h" |
| 18 #include "content/public/common/content_client.h" | 17 #include "content/public/common/content_client.h" |
| 19 #include "content/public/common/origin_trial_policy.h" | 18 #include "content/public/common/origin_trial_policy.h" |
| 20 #include "content/public/test/test_browser_thread_bundle.h" | 19 #include "content/public/test/test_browser_thread_bundle.h" |
| 21 #include "content/test/test_content_browser_client.h" | 20 #include "content/test/test_content_browser_client.h" |
| 22 #include "net/http/http_response_info.h" | 21 #include "net/http/http_response_info.h" |
| 23 #include "net/test/cert_test_util.h" | 22 #include "net/test/cert_test_util.h" |
| 24 #include "net/test/test_data_directory.h" | 23 #include "net/test/test_data_directory.h" |
| 24 #include "net/test/url_request/mock_url_request_delegate.h" |
| 25 #include "net/url_request/url_request_context.h" | 25 #include "net/url_request/url_request_context.h" |
| 26 #include "storage/browser/blob/blob_storage_context.h" | 26 #include "storage/browser/blob/blob_storage_context.h" |
| 27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // This is a sample public key for testing the API. The corresponding private | 33 // This is a sample public key for testing the API. The corresponding private |
| 34 // key (use this to generate new samples for this test file) is: | 34 // key (use this to generate new samples for this test file) is: |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // Make sure new request only gets remaining timeout. | 377 // Make sure new request only gets remaining timeout. |
| 378 ForeignFetchRequestHandler* handler = | 378 ForeignFetchRequestHandler* handler = |
| 379 InitializeHandler("https://valid.example.com/foo", RESOURCE_TYPE_IMAGE, | 379 InitializeHandler("https://valid.example.com/foo", RESOURCE_TYPE_IMAGE, |
| 380 nullptr /* initiator */); | 380 nullptr /* initiator */); |
| 381 ASSERT_TRUE(handler); | 381 ASSERT_TRUE(handler); |
| 382 ASSERT_TRUE(timeout_for_request(handler).has_value()); | 382 ASSERT_TRUE(timeout_for_request(handler).has_value()); |
| 383 EXPECT_EQ(remaining_time, timeout_for_request(handler).value()); | 383 EXPECT_EQ(remaining_time, timeout_for_request(handler).value()); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace content | 386 } // namespace content |
| OLD | NEW |