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

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

Issue 2053693002: WIP: Move 'Upgrade-Insecure-Requests' to the browser process. Base URL: https://chromium.googlesource.com/chromium/src.git@replicate
Patch Set: Created 4 years, 6 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 std::unique_ptr<NavigationURLLoader> MakeTestLoader( 104 std::unique_ptr<NavigationURLLoader> MakeTestLoader(
105 const GURL& url, 105 const GURL& url,
106 NavigationURLLoaderDelegate* delegate) { 106 NavigationURLLoaderDelegate* delegate) {
107 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, 107 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false,
108 false, REQUEST_CONTEXT_TYPE_LOCATION); 108 false, REQUEST_CONTEXT_TYPE_LOCATION);
109 CommonNavigationParams common_params; 109 CommonNavigationParams common_params;
110 common_params.url = url; 110 common_params.url = url;
111 std::unique_ptr<NavigationRequestInfo> request_info( 111 std::unique_ptr<NavigationRequestInfo> request_info(
112 new NavigationRequestInfo(common_params, begin_params, url, 112 new NavigationRequestInfo(common_params, begin_params, url,
113 url::Origin(url), true, false, -1)); 113 url::Origin(url), false, true, false, -1));
114 114
115 return NavigationURLLoader::Create( 115 return NavigationURLLoader::Create(
116 browser_context_.get(), std::move(request_info), nullptr, delegate); 116 browser_context_.get(), std::move(request_info), nullptr, delegate);
117 } 117 }
118 118
119 // Helper function for fetching the body of a URL to a string. 119 // Helper function for fetching the body of a URL to a string.
120 std::string FetchURL(const GURL& url) { 120 std::string FetchURL(const GURL& url) {
121 net::TestDelegate delegate; 121 net::TestDelegate delegate;
122 net::URLRequestContext* request_context = 122 net::URLRequestContext* request_context =
123 browser_context_->GetResourceContext()->GetRequestContext(); 123 browser_context_->GetResourceContext()->GetRequestContext();
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 // Release the body. 329 // Release the body.
330 delegate.ReleaseBody(); 330 delegate.ReleaseBody();
331 base::RunLoop().RunUntilIdle(); 331 base::RunLoop().RunUntilIdle();
332 332
333 // Verify that URLRequestTestJob no longer has anything paused. 333 // Verify that URLRequestTestJob no longer has anything paused.
334 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); 334 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage());
335 } 335 }
336 336
337 } // namespace content 337 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698