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

Unified Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 6879114: Cancels prerendering on prerendering RenderView crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_browsertest.cc
===================================================================
--- chrome/browser/prerender/prerender_browsertest.cc (revision 82702)
+++ chrome/browser/prerender/prerender_browsertest.cc (working copy)
@@ -17,6 +17,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/test/in_process_browser_test.h"
#include "chrome/test/ui_test_utils.h"
+#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "grit/generated_resources.h"
#include "net/url_request/url_request_context.h"
@@ -77,6 +78,12 @@
if (expected_final_status_ == FINAL_STATUS_USED &&
number_of_loads_ >= expected_number_of_loads_) {
MessageLoopForUI::current()->Quit();
+ } else if (expected_final_status_ == FINAL_STATUS_RENDERER_CRASHED) {
+ // Crash the render process. This has to be done here because
+ // a prerender navigating to about:crash is cancelled with
+ // "FINAL_STATUS_HTTPS". Even if this were worked around,
+ // about:crash can't be navigated to by a normal webpage.
+ render_view_host()->NavigateToURL(GURL("about:crash"));
Paweł Hajdan Jr. 2011/04/26 12:00:43 nit: Please use a constant from content/common/url
}
}
@@ -670,4 +677,12 @@
NavigateToDestURL();
}
+// Checks that prerenderers will terminate when the RenderView crashes.
+// Note that the prerendering RenderView will be redirected to about:crash.
+IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderRendererCrash) {
+ PrerenderTestURL(CreateClientRedirect("files/prerender/prerender_page.html"),
+ FINAL_STATUS_RENDERER_CRASHED,
+ 1);
+}
+
} // namespace prerender
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698