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

Unified Diff: content/browser/web_contents/web_contents_impl_browsertest.cc

Issue 2812743002: Revert of Keep track in the browser of which frames have onunload and onbeforeunload handlers. (Closed)
Patch Set: manual merge Created 3 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
Index: content/browser/web_contents/web_contents_impl_browsertest.cc
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc
index 1f4da833c88c4e8705a8a5f42dfa15462548d689..457ec145f602f5549c4c0022453208964cb3eb7d 100644
--- a/content/browser/web_contents/web_contents_impl_browsertest.cc
+++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -1020,29 +1020,6 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
}
namespace {
-void NavigateToDataURLAndExpectBeforeUnload(Shell* shell,
- const std::string& html,
- bool expect_onbeforeunload) {
- NavigateToURL(shell, GURL("data:text/html," + html));
- RenderFrameHostImpl* rfh =
- static_cast<RenderFrameHostImpl*>(shell->web_contents()->GetMainFrame());
- EXPECT_EQ(expect_onbeforeunload, rfh->ShouldDispatchBeforeUnload());
-}
-} // namespace
-
-IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, NoOnBeforeUnload) {
- const std::string NO_BEFORE_UNLOAD_HTML = "<html><body>foo</body></html>";
- NavigateToDataURLAndExpectBeforeUnload(shell(), NO_BEFORE_UNLOAD_HTML, false);
-}
-
-IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, OnBeforeUnload) {
- const std::string BEFORE_UNLOAD_HTML =
- "<html><body><script>window.onbeforeunload=function(e) {}</script>"
- "</body></html>";
- NavigateToDataURLAndExpectBeforeUnload(shell(), BEFORE_UNLOAD_HTML, true);
-}
-
-namespace {
class TestJavaScriptDialogManager : public JavaScriptDialogManager,
public WebContentsDelegate {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698