| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 | 1076 |
| 1077 // Creates and drives a main resource request until completion. Then asserts | 1077 // Creates and drives a main resource request until completion. Then asserts |
| 1078 // that the expected_error_code has been emitted for the request. | 1078 // that the expected_error_code has been emitted for the request. |
| 1079 void CompleteFailingMainResourceRequest(const GURL& url, | 1079 void CompleteFailingMainResourceRequest(const GURL& url, |
| 1080 int expected_error_code) { | 1080 int expected_error_code) { |
| 1081 if (IsBrowserSideNavigationEnabled()) { | 1081 if (IsBrowserSideNavigationEnabled()) { |
| 1082 auto_advance_ = true; | 1082 auto_advance_ = true; |
| 1083 | 1083 |
| 1084 // Make a navigation request. | 1084 // Make a navigation request. |
| 1085 TestNavigationURLLoaderDelegate delegate; | 1085 TestNavigationURLLoaderDelegate delegate; |
| 1086 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, | 1086 BeginNavigationParams begin_params( |
| 1087 false, REQUEST_CONTEXT_TYPE_LOCATION, | 1087 std::string(), net::LOAD_NORMAL, false, false, |
| 1088 url::Origin(url)); | 1088 REQUEST_CONTEXT_TYPE_LOCATION, |
| 1089 blink::WebMixedContentContextType::Blockable, url::Origin(url)); |
| 1089 CommonNavigationParams common_params; | 1090 CommonNavigationParams common_params; |
| 1090 common_params.url = url; | 1091 common_params.url = url; |
| 1091 std::unique_ptr<NavigationRequestInfo> request_info( | 1092 std::unique_ptr<NavigationRequestInfo> request_info( |
| 1092 new NavigationRequestInfo(common_params, begin_params, url, true, | 1093 new NavigationRequestInfo(common_params, begin_params, url, true, |
| 1093 false, false, -1, false, false, | 1094 false, false, -1, false, false, |
| 1094 blink::WebPageVisibilityStateVisible)); | 1095 blink::WebPageVisibilityStateVisible)); |
| 1095 std::unique_ptr<NavigationURLLoader> test_loader = | 1096 std::unique_ptr<NavigationURLLoader> test_loader = |
| 1096 NavigationURLLoader::Create(browser_context_.get(), | 1097 NavigationURLLoader::Create(browser_context_.get(), |
| 1097 std::move(request_info), nullptr, nullptr, | 1098 std::move(request_info), nullptr, nullptr, |
| 1098 nullptr, &delegate); | 1099 nullptr, &delegate); |
| (...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2634 | 2635 |
| 2635 SetResponse(raw_headers, response_data); | 2636 SetResponse(raw_headers, response_data); |
| 2636 job_factory_->SetDelayedCompleteJobGeneration(true); | 2637 job_factory_->SetDelayedCompleteJobGeneration(true); |
| 2637 HandleScheme("http"); | 2638 HandleScheme("http"); |
| 2638 | 2639 |
| 2639 const GURL download_url = GURL("http://example.com/blah"); | 2640 const GURL download_url = GURL("http://example.com/blah"); |
| 2640 | 2641 |
| 2641 if (IsBrowserSideNavigationEnabled()) { | 2642 if (IsBrowserSideNavigationEnabled()) { |
| 2642 // Create a NavigationRequest. | 2643 // Create a NavigationRequest. |
| 2643 TestNavigationURLLoaderDelegate delegate; | 2644 TestNavigationURLLoaderDelegate delegate; |
| 2644 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, | 2645 BeginNavigationParams begin_params( |
| 2645 false, REQUEST_CONTEXT_TYPE_LOCATION, | 2646 std::string(), net::LOAD_NORMAL, false, false, |
| 2646 url::Origin(download_url)); | 2647 REQUEST_CONTEXT_TYPE_LOCATION, |
| 2648 blink::WebMixedContentContextType::Blockable, |
| 2649 url::Origin(download_url)); |
| 2647 CommonNavigationParams common_params; | 2650 CommonNavigationParams common_params; |
| 2648 common_params.url = download_url; | 2651 common_params.url = download_url; |
| 2649 std::unique_ptr<NavigationRequestInfo> request_info( | 2652 std::unique_ptr<NavigationRequestInfo> request_info( |
| 2650 new NavigationRequestInfo(common_params, begin_params, download_url, | 2653 new NavigationRequestInfo(common_params, begin_params, download_url, |
| 2651 true, false, false, -1, false, false, | 2654 true, false, false, -1, false, false, |
| 2652 blink::WebPageVisibilityStateVisible)); | 2655 blink::WebPageVisibilityStateVisible)); |
| 2653 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( | 2656 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( |
| 2654 browser_context_.get(), std::move(request_info), nullptr, nullptr, | 2657 browser_context_.get(), std::move(request_info), nullptr, nullptr, |
| 2655 nullptr, &delegate); | 2658 nullptr, &delegate); |
| 2656 | 2659 |
| (...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3991 return nullptr; | 3994 return nullptr; |
| 3992 } | 3995 } |
| 3993 | 3996 |
| 3994 INSTANTIATE_TEST_CASE_P( | 3997 INSTANTIATE_TEST_CASE_P( |
| 3995 ResourceDispatcherHostTests, | 3998 ResourceDispatcherHostTests, |
| 3996 ResourceDispatcherHostTest, | 3999 ResourceDispatcherHostTest, |
| 3997 testing::Values(TestConfig::kDefault, | 4000 testing::Values(TestConfig::kDefault, |
| 3998 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 4001 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
| 3999 | 4002 |
| 4000 } // namespace content | 4003 } // namespace content |
| OLD | NEW |