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

Unified Diff: chrome/browser/ui/browser_browsertest.cc

Issue 1156663004: Test for cancelling PDF modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use separate PDF test file, add comments. Created 5 years, 7 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/test/data/pdf/alert_dialog.pdf » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_browsertest.cc
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index 68eb19fd26dd6dfafbccf28e13731484a0caae51..ac7006e7ebd7bc51705ac8088a107920dd08b58c 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -586,6 +586,31 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, SadTabCancelsSubframeDialogs) {
ui_test_utils::NavigateToURL(browser(), url2);
}
+// Make sure modal dialogs within a guestview are closed when an interstitial
+// page is showing. crbug.com/482380
+IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialCancelsGuestViewDialogs) {
+ ASSERT_TRUE(test_server()->Start());
+ GURL pdf_with_dialog(test_server()->GetURL("files/pdf/alert_dialog.pdf"));
+ ui_test_utils::NavigateToURL(browser(), pdf_with_dialog);
+
+ AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
+ EXPECT_TRUE(alert->IsValid());
+ AppModalDialogQueue* dialog_queue = AppModalDialogQueue::GetInstance();
+ EXPECT_TRUE(dialog_queue->HasActiveDialog());
+
+ WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
+
+ TestInterstitialPage* interstitial =
+ new TestInterstitialPage(contents, false, GURL());
+ content::WaitForInterstitialAttach(contents);
+
+ // The interstitial should have closed the dialog.
+ EXPECT_TRUE(contents->ShowingInterstitialPage());
+ EXPECT_FALSE(dialog_queue->HasActiveDialog());
+
+ interstitial->DontProceed();
+}
+
// Test for crbug.com/22004. Reloading a page with a before unload handler and
// then canceling the dialog should not leave the throbber spinning.
IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) {
« no previous file with comments | « no previous file | chrome/test/data/pdf/alert_dialog.pdf » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698