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 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 TestNavigationURLLoaderDelegate delegate; | 1060 TestNavigationURLLoaderDelegate delegate; |
1061 BeginNavigationParams begin_params( | 1061 BeginNavigationParams begin_params( |
1062 std::string(), net::LOAD_NORMAL, false, false, | 1062 std::string(), net::LOAD_NORMAL, false, false, |
1063 REQUEST_CONTEXT_TYPE_LOCATION, | 1063 REQUEST_CONTEXT_TYPE_LOCATION, |
1064 blink::WebMixedContentContextType::Blockable, | 1064 blink::WebMixedContentContextType::Blockable, |
1065 false, // is_form_submission | 1065 false, // is_form_submission |
1066 url::Origin(url)); | 1066 url::Origin(url)); |
1067 CommonNavigationParams common_params; | 1067 CommonNavigationParams common_params; |
1068 common_params.url = url; | 1068 common_params.url = url; |
1069 std::unique_ptr<NavigationRequestInfo> request_info( | 1069 std::unique_ptr<NavigationRequestInfo> request_info( |
1070 new NavigationRequestInfo(common_params, begin_params, url, true, | 1070 new NavigationRequestInfo( |
1071 false, false, -1, false, false, | 1071 common_params, begin_params, url, true, false, false, -1, false, |
1072 blink::WebPageVisibilityStateVisible)); | 1072 false, blink::WebPageVisibilityStateVisible, "", 0)); |
1073 std::unique_ptr<NavigationURLLoader> test_loader = | 1073 std::unique_ptr<NavigationURLLoader> test_loader = |
1074 NavigationURLLoader::Create( | 1074 NavigationURLLoader::Create( |
1075 browser_context_->GetResourceContext(), | 1075 browser_context_->GetResourceContext(), |
1076 BrowserContext::GetDefaultStoragePartition( | 1076 BrowserContext::GetDefaultStoragePartition( |
1077 browser_context_.get()), | 1077 browser_context_.get()), |
1078 std::move(request_info), nullptr, nullptr, nullptr, &delegate); | 1078 std::move(request_info), nullptr, nullptr, nullptr, &delegate); |
1079 | 1079 |
1080 // The navigation should fail with the expected error code. | 1080 // The navigation should fail with the expected error code. |
1081 delegate.WaitForRequestFailed(); | 1081 delegate.WaitForRequestFailed(); |
1082 ASSERT_EQ(expected_error_code, delegate.net_error()); | 1082 ASSERT_EQ(expected_error_code, delegate.net_error()); |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2580 std::string(), net::LOAD_NORMAL, false, false, | 2580 std::string(), net::LOAD_NORMAL, false, false, |
2581 REQUEST_CONTEXT_TYPE_LOCATION, | 2581 REQUEST_CONTEXT_TYPE_LOCATION, |
2582 blink::WebMixedContentContextType::Blockable, | 2582 blink::WebMixedContentContextType::Blockable, |
2583 false, // is_form_submission | 2583 false, // is_form_submission |
2584 url::Origin(download_url)); | 2584 url::Origin(download_url)); |
2585 CommonNavigationParams common_params; | 2585 CommonNavigationParams common_params; |
2586 common_params.url = download_url; | 2586 common_params.url = download_url; |
2587 std::unique_ptr<NavigationRequestInfo> request_info( | 2587 std::unique_ptr<NavigationRequestInfo> request_info( |
2588 new NavigationRequestInfo(common_params, begin_params, download_url, | 2588 new NavigationRequestInfo(common_params, begin_params, download_url, |
2589 true, false, false, -1, false, false, | 2589 true, false, false, -1, false, false, |
2590 blink::WebPageVisibilityStateVisible)); | 2590 blink::WebPageVisibilityStateVisible, "", 0)); |
2591 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( | 2591 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( |
2592 browser_context_->GetResourceContext(), | 2592 browser_context_->GetResourceContext(), |
2593 BrowserContext::GetDefaultStoragePartition(browser_context_.get()), | 2593 BrowserContext::GetDefaultStoragePartition(browser_context_.get()), |
2594 std::move(request_info), nullptr, nullptr, nullptr, &delegate); | 2594 std::move(request_info), nullptr, nullptr, nullptr, &delegate); |
2595 | 2595 |
2596 // Wait until a response has been received and proceed with the response. | 2596 // Wait until a response has been received and proceed with the response. |
2597 KickOffRequest(); | 2597 KickOffRequest(); |
2598 | 2598 |
2599 // Return some data so that the request is identified as a download | 2599 // Return some data so that the request is identified as a download |
2600 // and the proper resource handlers are created. | 2600 // and the proper resource handlers are created. |
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3924 return nullptr; | 3924 return nullptr; |
3925 } | 3925 } |
3926 | 3926 |
3927 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse( | 3927 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse( |
3928 net::URLRequest* request, | 3928 net::URLRequest* request, |
3929 net::NetworkDelegate* network_delegate) const { | 3929 net::NetworkDelegate* network_delegate) const { |
3930 return nullptr; | 3930 return nullptr; |
3931 } | 3931 } |
3932 | 3932 |
3933 } // namespace content | 3933 } // namespace content |
OLD | NEW |