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

Unified Diff: chrome/browser/crash_recovery_browsertest.cc

Issue 2373273002: Run unload handlers when navigating to about:blank using PlzNavigate. (Closed)
Patch Set: undo incorrect change that broke chrome://crash Created 4 years, 2 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/extensions/extension_resource_request_policy_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/crash_recovery_browsertest.cc
diff --git a/chrome/browser/crash_recovery_browsertest.cc b/chrome/browser/crash_recovery_browsertest.cc
index d9702e651938fbc7f3e296e3450695bfc1f253aa..9634546b07c78bd244ad3e08d1ae1ee4c992f3fb 100644
--- a/chrome/browser/crash_recovery_browsertest.cc
+++ b/chrome/browser/crash_recovery_browsertest.cc
@@ -176,6 +176,18 @@ IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, DoubleReloadWithError) {
ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL());
}
+// Tests that a beforeunload handler doesn't run if user navigates to
+// chrome::crash.
+IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, BeforeUnloadNotRun) {
+ const char* kBeforeUnloadHTML =
+ "<html><body>"
+ "<script>window.onbeforeunload=function(e){return 'foo'}</script>"
+ "</body></html>";
+ GURL url(std::string("data:text/html,") + kBeforeUnloadHTML);
+ ui_test_utils::NavigateToURL(browser(), url);
+ SimulateRendererCrash(browser());
+}
+
} // namespace
#endif
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_resource_request_policy_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698