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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 void CompleteFailingMainResourceRequest(const GURL& url, | 1075 void CompleteFailingMainResourceRequest(const GURL& url, |
1076 int expected_error_code) { | 1076 int expected_error_code) { |
1077 if (IsBrowserSideNavigationEnabled()) { | 1077 if (IsBrowserSideNavigationEnabled()) { |
1078 auto_advance_ = true; | 1078 auto_advance_ = true; |
1079 | 1079 |
1080 // Make a navigation request. | 1080 // Make a navigation request. |
1081 TestNavigationURLLoaderDelegate delegate; | 1081 TestNavigationURLLoaderDelegate delegate; |
1082 BeginNavigationParams begin_params( | 1082 BeginNavigationParams begin_params( |
1083 std::string(), net::LOAD_NORMAL, false, false, | 1083 std::string(), net::LOAD_NORMAL, false, false, |
1084 REQUEST_CONTEXT_TYPE_LOCATION, | 1084 REQUEST_CONTEXT_TYPE_LOCATION, |
1085 blink::WebMixedContentContextType::Blockable, url::Origin(url)); | 1085 blink::WebMixedContentContextType::Blockable, url::Origin(url), |
| 1086 kInvalidRenderNavigationId); |
1086 CommonNavigationParams common_params; | 1087 CommonNavigationParams common_params; |
1087 common_params.url = url; | 1088 common_params.url = url; |
1088 std::unique_ptr<NavigationRequestInfo> request_info( | 1089 std::unique_ptr<NavigationRequestInfo> request_info( |
1089 new NavigationRequestInfo(common_params, begin_params, url, true, | 1090 new NavigationRequestInfo(common_params, begin_params, url, true, |
1090 false, false, -1, false, false, | 1091 false, false, -1, false, false, |
1091 blink::WebPageVisibilityStateVisible)); | 1092 blink::WebPageVisibilityStateVisible)); |
1092 std::unique_ptr<NavigationURLLoader> test_loader = | 1093 std::unique_ptr<NavigationURLLoader> test_loader = |
1093 NavigationURLLoader::Create( | 1094 NavigationURLLoader::Create( |
1094 browser_context_->GetResourceContext(), | 1095 browser_context_->GetResourceContext(), |
1095 BrowserContext::GetDefaultStoragePartition( | 1096 BrowserContext::GetDefaultStoragePartition( |
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 HandleScheme("http"); | 2637 HandleScheme("http"); |
2637 | 2638 |
2638 const GURL download_url = GURL("http://example.com/blah"); | 2639 const GURL download_url = GURL("http://example.com/blah"); |
2639 | 2640 |
2640 if (IsBrowserSideNavigationEnabled()) { | 2641 if (IsBrowserSideNavigationEnabled()) { |
2641 // Create a NavigationRequest. | 2642 // Create a NavigationRequest. |
2642 TestNavigationURLLoaderDelegate delegate; | 2643 TestNavigationURLLoaderDelegate delegate; |
2643 BeginNavigationParams begin_params( | 2644 BeginNavigationParams begin_params( |
2644 std::string(), net::LOAD_NORMAL, false, false, | 2645 std::string(), net::LOAD_NORMAL, false, false, |
2645 REQUEST_CONTEXT_TYPE_LOCATION, | 2646 REQUEST_CONTEXT_TYPE_LOCATION, |
2646 blink::WebMixedContentContextType::Blockable, | 2647 blink::WebMixedContentContextType::Blockable, url::Origin(download_url), |
2647 url::Origin(download_url)); | 2648 kInvalidRenderNavigationId); |
2648 CommonNavigationParams common_params; | 2649 CommonNavigationParams common_params; |
2649 common_params.url = download_url; | 2650 common_params.url = download_url; |
2650 std::unique_ptr<NavigationRequestInfo> request_info( | 2651 std::unique_ptr<NavigationRequestInfo> request_info( |
2651 new NavigationRequestInfo(common_params, begin_params, download_url, | 2652 new NavigationRequestInfo(common_params, begin_params, download_url, |
2652 true, false, false, -1, false, false, | 2653 true, false, false, -1, false, false, |
2653 blink::WebPageVisibilityStateVisible)); | 2654 blink::WebPageVisibilityStateVisible)); |
2654 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( | 2655 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( |
2655 browser_context_->GetResourceContext(), | 2656 browser_context_->GetResourceContext(), |
2656 BrowserContext::GetDefaultStoragePartition(browser_context_.get()), | 2657 BrowserContext::GetDefaultStoragePartition(browser_context_.get()), |
2657 std::move(request_info), nullptr, nullptr, nullptr, &delegate); | 2658 std::move(request_info), nullptr, nullptr, nullptr, &delegate); |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3993 return nullptr; | 3994 return nullptr; |
3994 } | 3995 } |
3995 | 3996 |
3996 INSTANTIATE_TEST_CASE_P( | 3997 INSTANTIATE_TEST_CASE_P( |
3997 ResourceDispatcherHostTests, | 3998 ResourceDispatcherHostTests, |
3998 ResourceDispatcherHostTest, | 3999 ResourceDispatcherHostTest, |
3999 testing::Values(TestConfig::kDefault, | 4000 testing::Values(TestConfig::kDefault, |
4000 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 4001 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
4001 | 4002 |
4002 } // namespace content | 4003 } // namespace content |
OLD | NEW |