| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 176 | 176 | 
| 177   scoped_ptr<NavigationURLLoader> MakeTestLoader( | 177   scoped_ptr<NavigationURLLoader> MakeTestLoader( | 
| 178       const GURL& url, | 178       const GURL& url, | 
| 179       NavigationURLLoaderDelegate* delegate) { | 179       NavigationURLLoaderDelegate* delegate) { | 
| 180     BeginNavigationParams begin_params( | 180     BeginNavigationParams begin_params( | 
| 181         "GET", std::string(), net::LOAD_NORMAL, false); | 181         "GET", std::string(), net::LOAD_NORMAL, false); | 
| 182     CommonNavigationParams common_params; | 182     CommonNavigationParams common_params; | 
| 183     common_params.url = url; | 183     common_params.url = url; | 
| 184     scoped_ptr<NavigationRequestInfo> request_info( | 184     scoped_ptr<NavigationRequestInfo> request_info( | 
| 185         new NavigationRequestInfo(common_params, begin_params, url, true, false, | 185         new NavigationRequestInfo(common_params, begin_params, url, true, false, | 
| 186                                   scoped_refptr<ResourceRequestBody>())); | 186                                   -1, scoped_refptr<ResourceRequestBody>())); | 
| 187 | 187 | 
| 188     return NavigationURLLoader::Create( | 188     return NavigationURLLoader::Create( | 
| 189         browser_context_.get(), 0, request_info.Pass(), delegate); | 189         browser_context_.get(), 0, request_info.Pass(), delegate); | 
| 190   } | 190   } | 
| 191 | 191 | 
| 192   // Helper function for fetching the body of a URL to a string. | 192   // Helper function for fetching the body of a URL to a string. | 
| 193   std::string FetchURL(const GURL& url) { | 193   std::string FetchURL(const GURL& url) { | 
| 194     net::TestDelegate delegate; | 194     net::TestDelegate delegate; | 
| 195     net::URLRequestContext* request_context = | 195     net::URLRequestContext* request_context = | 
| 196         browser_context_->GetResourceContext()->GetRequestContext(); | 196         browser_context_->GetResourceContext()->GetRequestContext(); | 
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 393 | 393 | 
| 394   // Release the body. | 394   // Release the body. | 
| 395   delegate.ReleaseBody(); | 395   delegate.ReleaseBody(); | 
| 396   base::RunLoop().RunUntilIdle(); | 396   base::RunLoop().RunUntilIdle(); | 
| 397 | 397 | 
| 398   // Verify that URLRequestTestJob no longer has anything paused. | 398   // Verify that URLRequestTestJob no longer has anything paused. | 
| 399   EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); | 399   EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); | 
| 400 } | 400 } | 
| 401 | 401 | 
| 402 }  // namespace content | 402 }  // namespace content | 
| OLD | NEW | 
|---|