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