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

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

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 months 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
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( 181 BeginNavigationParams begin_params(
182 "GET", std::string(), net::LOAD_NORMAL, false); 182 "GET", std::string(), net::LOAD_NORMAL, false, false,
183 REQUEST_CONTEXT_TYPE_LOCATION);
clamy 2015/08/31 12:09:27 nit: I would again initialize the context type to
Fabrice (no longer in Chrome) 2015/08/31 14:00:35 Done.
183 CommonNavigationParams common_params; 184 CommonNavigationParams common_params;
184 common_params.url = url; 185 common_params.url = url;
185 scoped_ptr<NavigationRequestInfo> request_info( 186 scoped_ptr<NavigationRequestInfo> request_info(
186 new NavigationRequestInfo(common_params, begin_params, url, true, false, 187 new NavigationRequestInfo(common_params, begin_params, url, true, false,
187 -1, scoped_refptr<ResourceRequestBody>())); 188 -1, scoped_refptr<ResourceRequestBody>()));
188 189
189 return NavigationURLLoader::Create( 190 return NavigationURLLoader::Create(
190 browser_context_.get(), 0, request_info.Pass(), delegate); 191 browser_context_.get(), 0, request_info.Pass(), delegate);
191 } 192 }
192 193
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 395
395 // Release the body. 396 // Release the body.
396 delegate.ReleaseBody(); 397 delegate.ReleaseBody();
397 base::RunLoop().RunUntilIdle(); 398 base::RunLoop().RunUntilIdle();
398 399
399 // Verify that URLRequestTestJob no longer has anything paused. 400 // Verify that URLRequestTestJob no longer has anything paused.
400 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); 401 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage());
401 } 402 }
402 403
403 } // namespace content 404 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698