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

Unified Diff: components/web_modal/web_contents_modal_dialog_manager_unittest.cc

Issue 23981002: Provide configurable closing of web contents modal dialogs on interstitial webui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + add test comment Created 7 years, 3 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 | « components/web_modal/web_contents_modal_dialog_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/web_modal/web_contents_modal_dialog_manager_unittest.cc
diff --git a/components/web_modal/web_contents_modal_dialog_manager_unittest.cc b/components/web_modal/web_contents_modal_dialog_manager_unittest.cc
index 837824e721c5c5a2441629b26cdb246719c10b90..31af59c39cb67941a39e12ef6bfe6626db849abc 100644
--- a/components/web_modal/web_contents_modal_dialog_manager_unittest.cc
+++ b/components/web_modal/web_contents_modal_dialog_manager_unittest.cc
@@ -245,6 +245,30 @@ TEST_F(WebContentsModalDialogManagerTest, VisibilityObservation) {
native_manager->GetDialogState(dialog1));
}
+// Test that attaching an interstitial WebUI page closes dialogs configured to
+// close on interstitial WebUI.
+TEST_F(WebContentsModalDialogManagerTest, InterstitialWebUI) {
+ const NativeWebContentsModalDialog dialog1 = MakeFakeDialog();
+ const NativeWebContentsModalDialog dialog2 = MakeFakeDialog();
+ const NativeWebContentsModalDialog dialog3 = MakeFakeDialog();
+
+ manager->ShowDialog(dialog1);
+ manager->ShowDialog(dialog2);
+ manager->ShowDialog(dialog3);
+
+ manager->SetCloseOnInterstitialWebUI(dialog1, true);
+ manager->SetCloseOnInterstitialWebUI(dialog3, true);
+
+ test_api->DidAttachInterstitialPage();
+ EXPECT_EQ(TestNativeWebContentsModalDialogManager::CLOSED,
+ native_manager->GetDialogState(dialog1));
+ EXPECT_EQ(TestNativeWebContentsModalDialogManager::SHOWN,
+ native_manager->GetDialogState(dialog2));
+ EXPECT_EQ(TestNativeWebContentsModalDialogManager::CLOSED,
+ native_manager->GetDialogState(dialog3));
+}
+
+
// Test that the first dialog is always shown, regardless of the order in which
// dialogs are closed.
TEST_F(WebContentsModalDialogManagerTest, CloseDialogs) {
« no previous file with comments | « components/web_modal/web_contents_modal_dialog_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698