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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 false, REQUEST_CONTEXT_TYPE_LOCATION); | 1092 false, REQUEST_CONTEXT_TYPE_LOCATION); |
1093 CommonNavigationParams common_params; | 1093 CommonNavigationParams common_params; |
1094 common_params.url = url; | 1094 common_params.url = url; |
1095 std::unique_ptr<NavigationRequestInfo> request_info( | 1095 std::unique_ptr<NavigationRequestInfo> request_info( |
1096 new NavigationRequestInfo(common_params, begin_params, url, | 1096 new NavigationRequestInfo(common_params, begin_params, url, |
1097 url::Origin(url), true, false, false, -1, | 1097 url::Origin(url), true, false, false, -1, |
1098 false, false)); | 1098 false, false)); |
1099 std::unique_ptr<NavigationURLLoader> test_loader = | 1099 std::unique_ptr<NavigationURLLoader> test_loader = |
1100 NavigationURLLoader::Create(browser_context_.get(), | 1100 NavigationURLLoader::Create(browser_context_.get(), |
1101 std::move(request_info), nullptr, nullptr, | 1101 std::move(request_info), nullptr, nullptr, |
1102 &delegate); | 1102 nullptr, &delegate); |
1103 | 1103 |
1104 // The navigation should fail with the expected error code. | 1104 // The navigation should fail with the expected error code. |
1105 delegate.WaitForRequestFailed(); | 1105 delegate.WaitForRequestFailed(); |
1106 ASSERT_EQ(expected_error_code, delegate.net_error()); | 1106 ASSERT_EQ(expected_error_code, delegate.net_error()); |
1107 return; | 1107 return; |
1108 } | 1108 } |
1109 | 1109 |
1110 MakeTestRequestWithResourceType(filter_.get(), 0, 1, url, | 1110 MakeTestRequestWithResourceType(filter_.get(), 0, 1, url, |
1111 RESOURCE_TYPE_MAIN_FRAME); | 1111 RESOURCE_TYPE_MAIN_FRAME); |
1112 | 1112 |
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2641 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, | 2641 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, |
2642 false, REQUEST_CONTEXT_TYPE_LOCATION); | 2642 false, REQUEST_CONTEXT_TYPE_LOCATION); |
2643 CommonNavigationParams common_params; | 2643 CommonNavigationParams common_params; |
2644 common_params.url = download_url; | 2644 common_params.url = download_url; |
2645 std::unique_ptr<NavigationRequestInfo> request_info( | 2645 std::unique_ptr<NavigationRequestInfo> request_info( |
2646 new NavigationRequestInfo(common_params, begin_params, download_url, | 2646 new NavigationRequestInfo(common_params, begin_params, download_url, |
2647 url::Origin(download_url), true, false, false, | 2647 url::Origin(download_url), true, false, false, |
2648 -1, false, false)); | 2648 -1, false, false)); |
2649 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( | 2649 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( |
2650 browser_context_.get(), std::move(request_info), nullptr, nullptr, | 2650 browser_context_.get(), std::move(request_info), nullptr, nullptr, |
2651 &delegate); | 2651 nullptr, &delegate); |
2652 | 2652 |
2653 // Wait until a response has been received and proceed with the response. | 2653 // Wait until a response has been received and proceed with the response. |
2654 KickOffRequest(); | 2654 KickOffRequest(); |
2655 | 2655 |
2656 // Return some data so that the request is identified as a download | 2656 // Return some data so that the request is identified as a download |
2657 // and the proper resource handlers are created. | 2657 // and the proper resource handlers are created. |
2658 EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage()); | 2658 EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage()); |
2659 base::RunLoop().RunUntilIdle(); | 2659 base::RunLoop().RunUntilIdle(); |
2660 | 2660 |
2661 // The UI thread will be informed that the navigation failed with an error | 2661 // The UI thread will be informed that the navigation failed with an error |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3935 return nullptr; | 3935 return nullptr; |
3936 } | 3936 } |
3937 | 3937 |
3938 INSTANTIATE_TEST_CASE_P( | 3938 INSTANTIATE_TEST_CASE_P( |
3939 ResourceDispatcherHostTests, | 3939 ResourceDispatcherHostTests, |
3940 ResourceDispatcherHostTest, | 3940 ResourceDispatcherHostTest, |
3941 testing::Values(TestConfig::kDefault, | 3941 testing::Values(TestConfig::kDefault, |
3942 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 3942 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
3943 | 3943 |
3944 } // namespace content | 3944 } // namespace content |
OLD | NEW |