Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)
Patch Set: Rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 void CompleteFailingMainResourceRequest(const GURL& url, 1075 void CompleteFailingMainResourceRequest(const GURL& url,
1076 int expected_error_code) { 1076 int expected_error_code) {
1077 if (IsBrowserSideNavigationEnabled()) { 1077 if (IsBrowserSideNavigationEnabled()) {
1078 auto_advance_ = true; 1078 auto_advance_ = true;
1079 1079
1080 // Make a navigation request. 1080 // Make a navigation request.
1081 TestNavigationURLLoaderDelegate delegate; 1081 TestNavigationURLLoaderDelegate delegate;
1082 BeginNavigationParams begin_params( 1082 BeginNavigationParams begin_params(
1083 std::string(), net::LOAD_NORMAL, false, false, 1083 std::string(), net::LOAD_NORMAL, false, false,
1084 REQUEST_CONTEXT_TYPE_LOCATION, 1084 REQUEST_CONTEXT_TYPE_LOCATION,
1085 blink::WebMixedContentContextType::Blockable, url::Origin(url)); 1085 blink::WebMixedContentContextType::Blockable,
1086 false, // is_form_submission
1087 url::Origin(url));
1086 CommonNavigationParams common_params; 1088 CommonNavigationParams common_params;
1087 common_params.url = url; 1089 common_params.url = url;
1088 std::unique_ptr<NavigationRequestInfo> request_info( 1090 std::unique_ptr<NavigationRequestInfo> request_info(
1089 new NavigationRequestInfo(common_params, begin_params, url, true, 1091 new NavigationRequestInfo(common_params, begin_params, url, true,
1090 false, false, -1, false, false, 1092 false, false, -1, false, false,
1091 blink::WebPageVisibilityStateVisible)); 1093 blink::WebPageVisibilityStateVisible));
1092 std::unique_ptr<NavigationURLLoader> test_loader = 1094 std::unique_ptr<NavigationURLLoader> test_loader =
1093 NavigationURLLoader::Create( 1095 NavigationURLLoader::Create(
1094 browser_context_->GetResourceContext(), 1096 browser_context_->GetResourceContext(),
1095 BrowserContext::GetDefaultStoragePartition( 1097 BrowserContext::GetDefaultStoragePartition(
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after
2637 2639
2638 const GURL download_url = GURL("http://example.com/blah"); 2640 const GURL download_url = GURL("http://example.com/blah");
2639 2641
2640 if (IsBrowserSideNavigationEnabled()) { 2642 if (IsBrowserSideNavigationEnabled()) {
2641 // Create a NavigationRequest. 2643 // Create a NavigationRequest.
2642 TestNavigationURLLoaderDelegate delegate; 2644 TestNavigationURLLoaderDelegate delegate;
2643 BeginNavigationParams begin_params( 2645 BeginNavigationParams begin_params(
2644 std::string(), net::LOAD_NORMAL, false, false, 2646 std::string(), net::LOAD_NORMAL, false, false,
2645 REQUEST_CONTEXT_TYPE_LOCATION, 2647 REQUEST_CONTEXT_TYPE_LOCATION,
2646 blink::WebMixedContentContextType::Blockable, 2648 blink::WebMixedContentContextType::Blockable,
2649 false, // is_form_submission
2647 url::Origin(download_url)); 2650 url::Origin(download_url));
2648 CommonNavigationParams common_params; 2651 CommonNavigationParams common_params;
2649 common_params.url = download_url; 2652 common_params.url = download_url;
2650 std::unique_ptr<NavigationRequestInfo> request_info( 2653 std::unique_ptr<NavigationRequestInfo> request_info(
2651 new NavigationRequestInfo(common_params, begin_params, download_url, 2654 new NavigationRequestInfo(common_params, begin_params, download_url,
2652 true, false, false, -1, false, false, 2655 true, false, false, -1, false, false,
2653 blink::WebPageVisibilityStateVisible)); 2656 blink::WebPageVisibilityStateVisible));
2654 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create( 2657 std::unique_ptr<NavigationURLLoader> loader = NavigationURLLoader::Create(
2655 browser_context_->GetResourceContext(), 2658 browser_context_->GetResourceContext(),
2656 BrowserContext::GetDefaultStoragePartition(browser_context_.get()), 2659 BrowserContext::GetDefaultStoragePartition(browser_context_.get()),
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
3993 return nullptr; 3996 return nullptr;
3994 } 3997 }
3995 3998
3996 INSTANTIATE_TEST_CASE_P( 3999 INSTANTIATE_TEST_CASE_P(
3997 ResourceDispatcherHostTests, 4000 ResourceDispatcherHostTests,
3998 ResourceDispatcherHostTest, 4001 ResourceDispatcherHostTest,
3999 testing::Values(TestConfig::kDefault, 4002 testing::Values(TestConfig::kDefault,
4000 TestConfig::kOptimizeIPCForSmallResourceEnabled)); 4003 TestConfig::kOptimizeIPCForSmallResourceEnabled));
4001 4004
4002 } // namespace content 4005 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader_unittest.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698