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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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), true, false, -1)); |
114 scoped_refptr<ResourceRequestBody>())); | |
115 | 114 |
116 return NavigationURLLoader::Create( | 115 return NavigationURLLoader::Create( |
117 browser_context_.get(), std::move(request_info), nullptr, delegate); | 116 browser_context_.get(), std::move(request_info), nullptr, delegate); |
118 } | 117 } |
119 | 118 |
120 // 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. |
121 std::string FetchURL(const GURL& url) { | 120 std::string FetchURL(const GURL& url) { |
122 net::TestDelegate delegate; | 121 net::TestDelegate delegate; |
123 net::URLRequestContext* request_context = | 122 net::URLRequestContext* request_context = |
124 browser_context_->GetResourceContext()->GetRequestContext(); | 123 browser_context_->GetResourceContext()->GetRequestContext(); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 328 |
330 // Release the body. | 329 // Release the body. |
331 delegate.ReleaseBody(); | 330 delegate.ReleaseBody(); |
332 base::RunLoop().RunUntilIdle(); | 331 base::RunLoop().RunUntilIdle(); |
333 | 332 |
334 // Verify that URLRequestTestJob no longer has anything paused. | 333 // Verify that URLRequestTestJob no longer has anything paused. |
335 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); | 334 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); |
336 } | 335 } |
337 | 336 |
338 } // namespace content | 337 } // namespace content |
OLD | NEW |