Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: content/browser/loader/navigation_url_loader_unittest.cc

Issue 1399363004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Kinuko's comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
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(), delegate); 191 request_info.Pass(), nullptr, delegate);
192 } 192 }
193 193
194 // Helper function for fetching the body of a URL to a string. 194 // Helper function for fetching the body of a URL to a string.
195 std::string FetchURL(const GURL& url) { 195 std::string FetchURL(const GURL& url) {
196 net::TestDelegate delegate; 196 net::TestDelegate delegate;
197 net::URLRequestContext* request_context = 197 net::URLRequestContext* request_context =
198 browser_context_->GetResourceContext()->GetRequestContext(); 198 browser_context_->GetResourceContext()->GetRequestContext();
199 scoped_ptr<net::URLRequest> request(request_context->CreateRequest( 199 scoped_ptr<net::URLRequest> request(request_context->CreateRequest(
200 url, net::DEFAULT_PRIORITY, &delegate)); 200 url, net::DEFAULT_PRIORITY, &delegate));
201 request->Start(); 201 request->Start();
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698