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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 143183009: When cross-site navigations are cancelled, delete the request being transferred (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: reupload, undo unneeded change Created 6 years, 10 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 | Annotate | Revision Log
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 <deque> 5 #include <deque>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 3603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3614 content::ContentBrowserClient* original_browser_client = 3614 content::ContentBrowserClient* original_browser_client =
3615 content::SetBrowserClientForTesting(&test_browser_client); 3615 content::SetBrowserClientForTesting(&test_browser_client);
3616 3616
3617 PrerenderTestURL( 3617 PrerenderTestURL(
3618 CreateServerRedirect("files/prerender/prerender_page.html"), 3618 CreateServerRedirect("files/prerender/prerender_page.html"),
3619 FINAL_STATUS_OPEN_URL, 0); 3619 FINAL_STATUS_OPEN_URL, 0);
3620 3620
3621 content::SetBrowserClientForTesting(original_browser_client); 3621 content::SetBrowserClientForTesting(original_browser_client);
3622 } 3622 }
3623 3623
3624 // Checks that URLRequests for prerenders being aborted on cross-process
3625 // navigation from a server redirect are cleaned up, so they don't keep cache
3626 // entries locked.
3627 // See http://crbug.com/341134
3628 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
3629 PrerenderCrossProcessServerRedirectNoHang) {
3630 const char kDestPath[] = "files/prerender/prerender_page.html";
3631 // Force everything to be a process swap.
3632 SwapProcessesContentBrowserClient test_browser_client;
3633 content::ContentBrowserClient* original_browser_client =
3634 content::SetBrowserClientForTesting(&test_browser_client);
3635
3636 PrerenderTestURL(CreateServerRedirect(kDestPath), FINAL_STATUS_OPEN_URL, 0);
3637
3638 content::SetBrowserClientForTesting(original_browser_client);
davidben 2014/02/13 21:08:47 Is there any particular reason to revert to the or
mmenke 2014/02/13 21:13:56 I did that because I wanted to test a "normal" nav
3639
3640 ui_test_utils::NavigateToURL(
3641 browser(),
3642 test_server()->GetURL(kDestPath));
3643 }
3644
3624 // Checks that prerenders are aborted on cross-process navigation from 3645 // Checks that prerenders are aborted on cross-process navigation from
3625 // a client redirect. 3646 // a client redirect.
3626 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 3647 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
3627 PrerenderCrossProcessClientRedirect) { 3648 PrerenderCrossProcessClientRedirect) {
3628 // Cross-process navigation logic for renderer-initiated navigations 3649 // Cross-process navigation logic for renderer-initiated navigations
3629 // is partially controlled by the renderer, namely 3650 // is partially controlled by the renderer, namely
3630 // ChromeContentRendererClient. This test instead relies on the Web 3651 // ChromeContentRendererClient. This test instead relies on the Web
3631 // Store triggering such navigations. 3652 // Store triggering such navigations.
3632 std::string webstore_url = extension_urls::GetWebstoreLaunchURL(); 3653 std::string webstore_url = extension_urls::GetWebstoreLaunchURL();
3633 3654
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
4062 } 4083 }
4063 }; 4084 };
4064 4085
4065 // Checks that prerendering works in incognito mode. 4086 // Checks that prerendering works in incognito mode.
4066 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) { 4087 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) {
4067 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); 4088 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
4068 NavigateToDestURL(); 4089 NavigateToDestURL();
4069 } 4090 }
4070 4091
4071 } // namespace prerender 4092 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698