| 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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 | 1069 |
| 1070 // Make a navigation request. | 1070 // Make a navigation request. |
| 1071 TestNavigationURLLoaderDelegate delegate; | 1071 TestNavigationURLLoaderDelegate delegate; |
| 1072 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, | 1072 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, |
| 1073 false, REQUEST_CONTEXT_TYPE_LOCATION); | 1073 false, REQUEST_CONTEXT_TYPE_LOCATION); |
| 1074 CommonNavigationParams common_params; | 1074 CommonNavigationParams common_params; |
| 1075 common_params.url = url; | 1075 common_params.url = url; |
| 1076 std::unique_ptr<NavigationRequestInfo> request_info( | 1076 std::unique_ptr<NavigationRequestInfo> request_info( |
| 1077 new NavigationRequestInfo(common_params, begin_params, url, | 1077 new NavigationRequestInfo(common_params, begin_params, url, |
| 1078 url::Origin(url), true, false, false, -1, | 1078 url::Origin(url), true, false, false, -1, |
| 1079 false, false)); | 1079 false, false, 0, nullptr)); |
| 1080 std::unique_ptr<NavigationURLLoader> test_loader = | 1080 std::unique_ptr<NavigationURLLoader> test_loader = |
| 1081 NavigationURLLoader::Create(browser_context_.get(), | 1081 NavigationURLLoader::Create(browser_context_.get(), |
| 1082 std::move(request_info), nullptr, nullptr, | 1082 std::move(request_info), nullptr, nullptr, |
| 1083 &delegate); | 1083 &delegate); |
| 1084 | 1084 |
| 1085 // The navigation should fail with the expected error code. | 1085 // The navigation should fail with the expected error code. |
| 1086 delegate.WaitForRequestFailed(); | 1086 delegate.WaitForRequestFailed(); |
| 1087 ASSERT_EQ(expected_error_code, delegate.net_error()); | 1087 ASSERT_EQ(expected_error_code, delegate.net_error()); |
| 1088 return; | 1088 return; |
| 1089 } | 1089 } |
| (...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2558 if (IsBrowserSideNavigationEnabled()) { | 2558 if (IsBrowserSideNavigationEnabled()) { |
| 2559 // Create a NavigationRequest. | 2559 // Create a NavigationRequest. |
| 2560 TestNavigationURLLoaderDelegate delegate; | 2560 TestNavigationURLLoaderDelegate delegate; |
| 2561 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, | 2561 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, |
| 2562 false, REQUEST_CONTEXT_TYPE_LOCATION); | 2562 false, REQUEST_CONTEXT_TYPE_LOCATION); |
| 2563 CommonNavigationParams common_params; | 2563 CommonNavigationParams common_params; |
| 2564 common_params.url = download_url; | 2564 common_params.url = download_url; |
| 2565 std::unique_ptr<NavigationRequestInfo> request_info( | 2565 std::unique_ptr<NavigationRequestInfo> request_info( |
| 2566 new NavigationRequestInfo(common_params, begin_params, download_url, | 2566 new NavigationRequestInfo(common_params, begin_params, download_url, |
| 2567 url::Origin(download_url), true, false, false, | 2567 url::Origin(download_url), true, false, false, |
| 2568 -1, false, false)); | 2568 -1, false, false, 0, nullptr)); |
| 2569 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( | 2569 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( |
| 2570 browser_context_.get(), std::move(request_info), nullptr, nullptr, | 2570 browser_context_.get(), std::move(request_info), nullptr, nullptr, |
| 2571 &delegate); | 2571 &delegate); |
| 2572 | 2572 |
| 2573 // Wait until a response has been received and proceed with the response. | 2573 // Wait until a response has been received and proceed with the response. |
| 2574 KickOffRequest(); | 2574 KickOffRequest(); |
| 2575 | 2575 |
| 2576 // Return some data so that the request is identified as a download | 2576 // Return some data so that the request is identified as a download |
| 2577 // and the proper resource handlers are created. | 2577 // and the proper resource handlers are created. |
| 2578 EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage()); | 2578 EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage()); |
| (...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3843 return nullptr; | 3843 return nullptr; |
| 3844 } | 3844 } |
| 3845 | 3845 |
| 3846 INSTANTIATE_TEST_CASE_P( | 3846 INSTANTIATE_TEST_CASE_P( |
| 3847 ResourceDispatcherHostTests, | 3847 ResourceDispatcherHostTests, |
| 3848 ResourceDispatcherHostTest, | 3848 ResourceDispatcherHostTest, |
| 3849 testing::Values(TestConfig::kDefault, | 3849 testing::Values(TestConfig::kDefault, |
| 3850 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 3850 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
| 3851 | 3851 |
| 3852 } // namespace content | 3852 } // namespace content |
| OLD | NEW |