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

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

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/browser/resource_dispatcher_host.h"
6
7 #include <utility>
8
5 #include "base/bind.h" 9 #include "base/bind.h"
6 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
7 #include "base/macros.h" 11 #include "base/macros.h"
8 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
9 #include "base/run_loop.h" 13 #include "base/run_loop.h"
10 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
11 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
12 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
13 #include "build/build_config.h" 17 #include "build/build_config.h"
14 #include "content/browser/download/download_manager_impl.h" 18 #include "content/browser/download/download_manager_impl.h"
15 #include "content/browser/web_contents/web_contents_impl.h" 19 #include "content/browser/web_contents/web_contents_impl.h"
16 #include "content/public/browser/browser_context.h" 20 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/browser_thread.h" 21 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/resource_dispatcher_host.h"
19 #include "content/public/browser/resource_dispatcher_host_delegate.h" 22 #include "content/public/browser/resource_dispatcher_host_delegate.h"
20 #include "content/public/browser/resource_request_info.h" 23 #include "content/public/browser/resource_request_info.h"
21 #include "content/public/browser/web_contents.h" 24 #include "content/public/browser/web_contents.h"
22 #include "content/public/common/url_constants.h" 25 #include "content/public/common/url_constants.h"
23 #include "content/public/test/browser_test_utils.h" 26 #include "content/public/test/browser_test_utils.h"
24 #include "content/public/test/content_browser_test.h" 27 #include "content/public/test/content_browser_test.h"
25 #include "content/public/test/content_browser_test_utils.h" 28 #include "content/public/test/content_browser_test_utils.h"
26 #include "content/public/test/test_navigation_observer.h" 29 #include "content/public/test/test_navigation_observer.h"
27 #include "content/public/test/test_utils.h" 30 #include "content/public/test/test_utils.h"
28 #include "content/shell/browser/shell.h" 31 #include "content/shell/browser/shell.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 scoped_ptr<net::test_server::HttpResponse> NoContentResponseHandler( 283 scoped_ptr<net::test_server::HttpResponse> NoContentResponseHandler(
281 const std::string& path, 284 const std::string& path,
282 const net::test_server::HttpRequest& request) { 285 const net::test_server::HttpRequest& request) {
283 if (!base::StartsWith(path, request.relative_url, 286 if (!base::StartsWith(path, request.relative_url,
284 base::CompareCase::SENSITIVE)) 287 base::CompareCase::SENSITIVE))
285 return scoped_ptr<net::test_server::HttpResponse>(); 288 return scoped_ptr<net::test_server::HttpResponse>();
286 289
287 scoped_ptr<net::test_server::BasicHttpResponse> http_response( 290 scoped_ptr<net::test_server::BasicHttpResponse> http_response(
288 new net::test_server::BasicHttpResponse); 291 new net::test_server::BasicHttpResponse);
289 http_response->set_code(net::HTTP_NO_CONTENT); 292 http_response->set_code(net::HTTP_NO_CONTENT);
290 return http_response.Pass(); 293 return std::move(http_response);
291 } 294 }
292 295
293 } // namespace 296 } // namespace
294 297
295 // Tests that the unload handler is not run for 204 responses. 298 // Tests that the unload handler is not run for 204 responses.
296 // If this flakes use http://crbug.com/80596. 299 // If this flakes use http://crbug.com/80596.
297 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, 300 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest,
298 CrossSiteNoUnloadOn204) { 301 CrossSiteNoUnloadOn204) {
299 ASSERT_TRUE(embedded_test_server()->Start()); 302 ASSERT_TRUE(embedded_test_server()->Start());
300 303
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 const net::test_server::HttpRequest& request) { 470 const net::test_server::HttpRequest& request) {
468 if (!base::StartsWith(request.relative_url, request_path, 471 if (!base::StartsWith(request.relative_url, request_path,
469 base::CompareCase::SENSITIVE)) 472 base::CompareCase::SENSITIVE))
470 return scoped_ptr<net::test_server::HttpResponse>(); 473 return scoped_ptr<net::test_server::HttpResponse>();
471 474
472 scoped_ptr<net::test_server::BasicHttpResponse> http_response( 475 scoped_ptr<net::test_server::BasicHttpResponse> http_response(
473 new net::test_server::BasicHttpResponse); 476 new net::test_server::BasicHttpResponse);
474 http_response->set_code(net::HTTP_FOUND); 477 http_response->set_code(net::HTTP_FOUND);
475 http_response->AddCustomHeader( 478 http_response->AddCustomHeader(
476 "Location", request.relative_url.substr(request_path.length())); 479 "Location", request.relative_url.substr(request_path.length()));
477 return http_response.Pass(); 480 return std::move(http_response);
478 } 481 }
479 482
480 } // namespace 483 } // namespace
481 484
482 // Test that we update the cookie policy URLs correctly when transferring 485 // Test that we update the cookie policy URLs correctly when transferring
483 // navigations. 486 // navigations.
484 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) { 487 IN_PROC_BROWSER_TEST_F(ResourceDispatcherHostBrowserTest, CookiePolicy) {
485 ASSERT_TRUE(embedded_test_server()->Start()); 488 ASSERT_TRUE(embedded_test_server()->Start());
486 embedded_test_server()->RegisterRequestHandler( 489 embedded_test_server()->RegisterRequestHandler(
487 base::Bind(&HandleRedirectRequest, "/redirect?")); 490 base::Bind(&HandleRedirectRequest, "/redirect?"));
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 749
747 // Reload with Lo-Fi disabled. 750 // Reload with Lo-Fi disabled.
748 Reset(false); 751 Reset(false);
749 TestNavigationObserver tab_observer(shell()->web_contents(), 1); 752 TestNavigationObserver tab_observer(shell()->web_contents(), 1);
750 shell()->web_contents()->GetController().ReloadDisableLoFi(true); 753 shell()->web_contents()->GetController().ReloadDisableLoFi(true);
751 tab_observer.Wait(); 754 tab_observer.Wait();
752 CheckResourcesRequested(false); 755 CheckResourcesRequested(false);
753 } 756 }
754 757
755 } // namespace content 758 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/redirect_to_file_resource_handler.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698