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

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: Style, placeholders, all that stuff Created 5 years, 4 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 // NavigationURLLoader is only used for browser-side navigations. 172 // NavigationURLLoader is only used for browser-side navigations.
173 base::CommandLine::ForCurrentProcess()->AppendSwitch( 173 base::CommandLine::ForCurrentProcess()->AppendSwitch(
174 switches::kEnableBrowserSideNavigation); 174 switches::kEnableBrowserSideNavigation);
175 } 175 }
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, false,
182 FETCH_REQUEST_MODE_NO_CORS, FETCH_CREDENTIALS_MODE_SAME_ORIGIN,
183 FetchRedirectMode::FOLLOW_MODE, REQUEST_CONTEXT_TYPE_LOCATION,
184 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL);
182 CommonNavigationParams common_params; 185 CommonNavigationParams common_params;
183 common_params.url = url; 186 common_params.url = url;
184 scoped_ptr<NavigationRequestInfo> request_info( 187 scoped_ptr<NavigationRequestInfo> request_info(
185 new NavigationRequestInfo(common_params, begin_params, url, true, false, 188 new NavigationRequestInfo(common_params, begin_params, url, true, false,
186 -1, scoped_refptr<ResourceRequestBody>())); 189 -1, scoped_refptr<ResourceRequestBody>()));
187 190
188 return NavigationURLLoader::Create( 191 return NavigationURLLoader::Create(
189 browser_context_.get(), 0, request_info.Pass(), delegate); 192 browser_context_.get(), 0, request_info.Pass(), delegate);
190 } 193 }
191 194
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 396
394 // Release the body. 397 // Release the body.
395 delegate.ReleaseBody(); 398 delegate.ReleaseBody();
396 base::RunLoop().RunUntilIdle(); 399 base::RunLoop().RunUntilIdle();
397 400
398 // Verify that URLRequestTestJob no longer has anything paused. 401 // Verify that URLRequestTestJob no longer has anything paused.
399 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); 402 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage());
400 } 403 }
401 404
402 } // namespace content 405 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698