| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 request_context->set_job_factory(&job_factory_); | 174 request_context->set_job_factory(&job_factory_); |
| 175 | 175 |
| 176 // NavigationURLLoader is only used for browser-side navigations. | 176 // NavigationURLLoader is only used for browser-side navigations. |
| 177 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 177 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 178 switches::kEnableBrowserSideNavigation); | 178 switches::kEnableBrowserSideNavigation); |
| 179 } | 179 } |
| 180 | 180 |
| 181 scoped_ptr<NavigationURLLoader> MakeTestLoader( | 181 scoped_ptr<NavigationURLLoader> MakeTestLoader( |
| 182 const GURL& url, | 182 const GURL& url, |
| 183 NavigationURLLoaderDelegate* delegate) { | 183 NavigationURLLoaderDelegate* delegate) { |
| 184 BeginNavigationParams begin_params("GET", std::string(), net::LOAD_NORMAL, | 184 BeginNavigationParams begin_params(std::string(), net::LOAD_NORMAL, false, |
| 185 false, false, | 185 false, REQUEST_CONTEXT_TYPE_LOCATION); |
| 186 REQUEST_CONTEXT_TYPE_LOCATION); | |
| 187 CommonNavigationParams common_params; | 186 CommonNavigationParams common_params; |
| 188 common_params.url = url; | 187 common_params.url = url; |
| 189 scoped_ptr<NavigationRequestInfo> request_info(new NavigationRequestInfo( | 188 scoped_ptr<NavigationRequestInfo> request_info(new NavigationRequestInfo( |
| 190 common_params, begin_params, url, url::Origin(url), true, false, -1, | 189 common_params, begin_params, url, url::Origin(url), true, false, -1, |
| 191 scoped_refptr<ResourceRequestBody>())); | 190 scoped_refptr<ResourceRequestBody>())); |
| 192 | 191 |
| 193 return NavigationURLLoader::Create( | 192 return NavigationURLLoader::Create( |
| 194 browser_context_.get(), std::move(request_info), nullptr, delegate); | 193 browser_context_.get(), std::move(request_info), nullptr, delegate); |
| 195 } | 194 } |
| 196 | 195 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 397 |
| 399 // Release the body. | 398 // Release the body. |
| 400 delegate.ReleaseBody(); | 399 delegate.ReleaseBody(); |
| 401 base::RunLoop().RunUntilIdle(); | 400 base::RunLoop().RunUntilIdle(); |
| 402 | 401 |
| 403 // Verify that URLRequestTestJob no longer has anything paused. | 402 // Verify that URLRequestTestJob no longer has anything paused. |
| 404 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); | 403 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); |
| 405 } | 404 } |
| 406 | 405 |
| 407 } // namespace content | 406 } // namespace content |
| OLD | NEW |