| 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 2638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 &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 delegate.WaitForResponseStarted(); |
| 2659 base::RunLoop().RunUntilIdle(); | 2660 base::RunLoop().RunUntilIdle(); |
| 2660 | 2661 |
| 2661 // The UI thread will be informed that the navigation failed with an error | 2662 // The UI thread will be informed that the navigation failed with an error |
| 2662 // code of ERR_ABORTED because the navigation turns out to be a download. | 2663 // code of ERR_ABORTED because the navigation turns out to be a download. |
| 2663 // The navigation is aborted, but the request goes on as a download. | 2664 // The navigation is aborted, but the request goes on as a download. |
| 2664 EXPECT_EQ(delegate.net_error(), net::ERR_ABORTED); | 2665 EXPECT_EQ(delegate.net_error(), net::ERR_ABORTED); |
| 2665 EXPECT_EQ(1, host_.pending_requests()); | 2666 EXPECT_EQ(1, host_.pending_requests()); |
| 2666 | 2667 |
| 2667 // In PlzNavigate, the renderer cannot cancel the request directly. | 2668 // In PlzNavigate, the renderer cannot cancel the request directly. |
| 2668 // However, cancelling by context should work. | 2669 // However, cancelling by context should work. |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3935 return nullptr; | 3936 return nullptr; |
| 3936 } | 3937 } |
| 3937 | 3938 |
| 3938 INSTANTIATE_TEST_CASE_P( | 3939 INSTANTIATE_TEST_CASE_P( |
| 3939 ResourceDispatcherHostTests, | 3940 ResourceDispatcherHostTests, |
| 3940 ResourceDispatcherHostTest, | 3941 ResourceDispatcherHostTest, |
| 3941 testing::Values(TestConfig::kDefault, | 3942 testing::Values(TestConfig::kDefault, |
| 3942 TestConfig::kOptimizeIPCForSmallResourceEnabled)); | 3943 TestConfig::kOptimizeIPCForSmallResourceEnabled)); |
| 3943 | 3944 |
| 3944 } // namespace content | 3945 } // namespace content |
| OLD | NEW |