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

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

Issue 1014623002: Revert "Refactor sudden termination" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + fixed compilation error Created 5 years, 9 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 | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl_unittest.cc
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 67e8e40b631a654f40b8d438f0b698d6bc1f2042..f8e1e38543a5032fc7541112f564cbb88af9c666 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -3062,50 +3062,4 @@ TEST_F(WebContentsImplTest, MediaPowerSaveBlocking) {
EXPECT_FALSE(contents()->has_audio_power_save_blocker_for_testing());
}
-// Test that sudden termination status is properly tracked for a frame.
-TEST_F(WebContentsImplTest, SuddenTerminationForFrame) {
- const GURL url("http://www.chromium.org");
- contents()->NavigateAndCommit(url);
-
- TestRenderFrameHost* frame = contents()->GetMainFrame();
- EXPECT_TRUE(frame->SuddenTerminationAllowed());
-
- // Register a BeforeUnload handler.
- frame->SendBeforeUnloadHandlersPresent(true);
- EXPECT_FALSE(frame->SuddenTerminationAllowed());
-
- // Unregister the BeforeUnload handler.
- frame->SendBeforeUnloadHandlersPresent(false);
- EXPECT_TRUE(frame->SuddenTerminationAllowed());
-
- // Register an Unload handler.
- frame->SendUnloadHandlersPresent(true);
- EXPECT_FALSE(frame->SuddenTerminationAllowed());
-
- // Unregister the Unload handler.
- frame->SendUnloadHandlersPresent(false);
- EXPECT_TRUE(frame->SuddenTerminationAllowed());
-
- // Register a BeforeUnload handler and an Unload handler.
- frame->SendBeforeUnloadHandlersPresent(true);
- frame->SendUnloadHandlersPresent(true);
- EXPECT_FALSE(frame->SuddenTerminationAllowed());
-
- // Override the sudden termination status.
- frame->set_override_sudden_termination_status(true);
- EXPECT_TRUE(frame->SuddenTerminationAllowed());
- frame->set_override_sudden_termination_status(false);
- EXPECT_FALSE(frame->SuddenTerminationAllowed());
-
- // Sudden termination should not be allowed unless there are no BeforeUnload
- // handlers and no Unload handlers in the RenderFrame.
- frame->SendBeforeUnloadHandlersPresent(false);
- EXPECT_FALSE(frame->SuddenTerminationAllowed());
- frame->SendBeforeUnloadHandlersPresent(true);
- frame->SendUnloadHandlersPresent(false);
- EXPECT_FALSE(frame->SuddenTerminationAllowed());
- frame->SendBeforeUnloadHandlersPresent(false);
- EXPECT_TRUE(frame->SuddenTerminationAllowed());
-}
-
} // namespace content
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698