diff options
author | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-06 05:17:59 +0000 |
---|---|---|
committer | wittman@chromium.org <wittman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-06 05:17:59 +0000 |
commit | a02358d357f618507170daf192a9485e51bbc3c0 (patch) | |
tree | c0059de683878844a86e6a4ede76d7baea8c0174 /components/web_modal/web_contents_modal_dialog_manager_unittest.cc | |
parent | 5e3484fcaf2acc8f3cf44db4fbb9a75596440d04 (diff) | |
download | chromium_src-a02358d357f618507170daf192a9485e51bbc3c0.zip chromium_src-a02358d357f618507170daf192a9485e51bbc3c0.tar.gz chromium_src-a02358d357f618507170daf192a9485e51bbc3c0.tar.bz2 |
Provide configurable closing of web contents modal dialogs on interstitial webui
Allow individual web contents modal dialog users to specify that dialogs
should be closed when encountering interstitial webui (e.g. due to
SSL warnings).
Future CLs will enable use of this functionality for most dialogs.
BUG=240575
Review URL: https://chromiumcodereview.appspot.com/23981002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/web_modal/web_contents_modal_dialog_manager_unittest.cc')
-rw-r--r-- | components/web_modal/web_contents_modal_dialog_manager_unittest.cc | 24 |
1 files changed, 24 insertions, 0 deletions
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 837824e..31af59c 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) { |