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

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

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Addressed all jam@ latest comments. Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 request_context->set_job_factory(&job_factory_); 99 request_context->set_job_factory(&job_factory_);
100 100
101 // NavigationURLLoader is only used for browser-side navigations. 101 // NavigationURLLoader is only used for browser-side navigations.
102 base::CommandLine::ForCurrentProcess()->AppendSwitch( 102 base::CommandLine::ForCurrentProcess()->AppendSwitch(
103 switches::kEnableBrowserSideNavigation); 103 switches::kEnableBrowserSideNavigation);
104 } 104 }
105 105
106 std::unique_ptr<NavigationURLLoader> MakeTestLoader( 106 std::unique_ptr<NavigationURLLoader> MakeTestLoader(
107 const GURL& url, 107 const GURL& url,
108 NavigationURLLoaderDelegate* delegate) { 108 NavigationURLLoaderDelegate* delegate) {
109 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, 109 BeginNavigationParams begin_params(
110 false, REQUEST_CONTEXT_TYPE_LOCATION, 110 std::string(), net::LOAD_NORMAL, false, false,
111 url::Origin(url)); 111 REQUEST_CONTEXT_TYPE_LOCATION,
112 blink::WebMixedContentContextType::Blockable, url::Origin(url));
112 CommonNavigationParams common_params; 113 CommonNavigationParams common_params;
113 common_params.url = url; 114 common_params.url = url;
114 std::unique_ptr<NavigationRequestInfo> request_info( 115 std::unique_ptr<NavigationRequestInfo> request_info(
115 new NavigationRequestInfo(common_params, begin_params, url, true, false, 116 new NavigationRequestInfo(common_params, begin_params, url, true, false,
116 false, -1, false, false, 117 false, -1, false, false,
117 blink::WebPageVisibilityStateVisible)); 118 blink::WebPageVisibilityStateVisible));
118 return NavigationURLLoader::Create(browser_context_.get(), 119 return NavigationURLLoader::Create(browser_context_.get(),
119 std::move(request_info), nullptr, 120 std::move(request_info), nullptr,
120 nullptr, nullptr, delegate); 121 nullptr, nullptr, delegate);
121 } 122 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 334
334 // Release the body. 335 // Release the body.
335 delegate.ReleaseBody(); 336 delegate.ReleaseBody();
336 base::RunLoop().RunUntilIdle(); 337 base::RunLoop().RunUntilIdle();
337 338
338 // Verify that URLRequestTestJob no longer has anything paused. 339 // Verify that URLRequestTestJob no longer has anything paused.
339 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); 340 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage());
340 } 341 }
341 342
342 } // namespace content 343 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698