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