| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(std::string(), net::LOAD_NORMAL, false, |
| 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( |
| 115 url::Origin(url), true, false, false, -1, | 115 common_params, begin_params, url, url::Origin(url), true, false, |
| 116 false, false)); | 116 false, -1, false, false, blink::WebPageVisibilityStateVisible)); |
| 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, 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 = |
| (...skipping 206 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 |