OLD | NEW |
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 REQUEST_CONTEXT_TYPE_LOCATION); | 110 REQUEST_CONTEXT_TYPE_LOCATION); |
111 CommonNavigationParams common_params; | 111 CommonNavigationParams common_params; |
112 common_params.url = url; | 112 common_params.url = url; |
113 std::unique_ptr<NavigationRequestInfo> request_info( | 113 std::unique_ptr<NavigationRequestInfo> request_info( |
114 new NavigationRequestInfo(common_params, begin_params, url, | 114 new NavigationRequestInfo(common_params, begin_params, url, |
115 url::Origin(url), true, false, false, -1, | 115 url::Origin(url), true, false, false, -1, |
116 false, false)); | 116 false, false)); |
117 | 117 |
118 return NavigationURLLoader::Create(browser_context_.get(), | 118 return NavigationURLLoader::Create(browser_context_.get(), |
119 std::move(request_info), nullptr, | 119 std::move(request_info), nullptr, |
120 nullptr, delegate); | 120 nullptr, nullptr, delegate); |
121 } | 121 } |
122 | 122 |
123 // Helper function for fetching the body of a URL to a string. | 123 // Helper function for fetching the body of a URL to a string. |
124 std::string FetchURL(const GURL& url) { | 124 std::string FetchURL(const GURL& url) { |
125 net::TestDelegate delegate; | 125 net::TestDelegate delegate; |
126 net::URLRequestContext* request_context = | 126 net::URLRequestContext* request_context = |
127 browser_context_->GetResourceContext()->GetRequestContext(); | 127 browser_context_->GetResourceContext()->GetRequestContext(); |
128 std::unique_ptr<net::URLRequest> request( | 128 std::unique_ptr<net::URLRequest> request( |
129 request_context->CreateRequest(url, net::DEFAULT_PRIORITY, &delegate)); | 129 request_context->CreateRequest(url, net::DEFAULT_PRIORITY, &delegate)); |
130 request->Start(); | 130 request->Start(); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 // Release the body. | 334 // Release the body. |
335 delegate.ReleaseBody(); | 335 delegate.ReleaseBody(); |
336 base::RunLoop().RunUntilIdle(); | 336 base::RunLoop().RunUntilIdle(); |
337 | 337 |
338 // Verify that URLRequestTestJob no longer has anything paused. | 338 // Verify that URLRequestTestJob no longer has anything paused. |
339 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); | 339 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); |
340 } | 340 } |
341 | 341 |
342 } // namespace content | 342 } // namespace content |
OLD | NEW |