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

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 1150843002: Dismiss browser plugin modal dialogs when the embedder needs to. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move test file Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/alert_dialog.pdf » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); 579 content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
580 child_process->Shutdown(0, false); 580 child_process->Shutdown(0, false);
581 crash_observer.Wait(); 581 crash_observer.Wait();
582 EXPECT_FALSE(dialog_queue->HasActiveDialog()); 582 EXPECT_FALSE(dialog_queue->HasActiveDialog());
583 583
584 // Make sure subsequent navigations work. 584 // Make sure subsequent navigations work.
585 GURL url2("data:text/html,foo"); 585 GURL url2("data:text/html,foo");
586 ui_test_utils::NavigateToURL(browser(), url2); 586 ui_test_utils::NavigateToURL(browser(), url2);
587 } 587 }
588 588
589 // Make sure modal dialogs within a guestview are closed when an interstitial
590 // page is showing. See crbug.com/482380.
591 IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialCancelsGuestViewDialogs) {
592 // Navigate to a PDF, which is loaded within a guestview.
593 ASSERT_TRUE(test_server()->Start());
594 GURL pdf_with_dialog(test_server()->GetURL("files/alert_dialog.pdf"));
595 ui_test_utils::NavigateToURL(browser(), pdf_with_dialog);
596
597 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
598 EXPECT_TRUE(alert->IsValid());
599 AppModalDialogQueue* dialog_queue = AppModalDialogQueue::GetInstance();
600 EXPECT_TRUE(dialog_queue->HasActiveDialog());
601
602 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
603
604 TestInterstitialPage* interstitial =
605 new TestInterstitialPage(contents, false, GURL());
606 content::WaitForInterstitialAttach(contents);
607
608 // The interstitial should have closed the dialog.
609 EXPECT_TRUE(contents->ShowingInterstitialPage());
610 EXPECT_FALSE(dialog_queue->HasActiveDialog());
611
612 interstitial->DontProceed();
613 }
614
589 // Test for crbug.com/22004. Reloading a page with a before unload handler and 615 // Test for crbug.com/22004. Reloading a page with a before unload handler and
590 // then canceling the dialog should not leave the throbber spinning. 616 // then canceling the dialog should not leave the throbber spinning.
591 IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) { 617 IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) {
592 GURL url(std::string("data:text/html,") + kBeforeUnloadHTML); 618 GURL url(std::string("data:text/html,") + kBeforeUnloadHTML);
593 ui_test_utils::NavigateToURL(browser(), url); 619 ui_test_utils::NavigateToURL(browser(), url);
594 620
595 // Navigate to another page, but click cancel in the dialog. Make sure that 621 // Navigate to another page, but click cancel in the dialog. Make sure that
596 // the throbber stops spinning. 622 // the throbber stops spinning.
597 chrome::Reload(browser(), CURRENT_TAB); 623 chrome::Reload(browser(), CURRENT_TAB);
598 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); 624 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2706 #endif 2732 #endif
2707 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2733 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2708 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2734 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2709 gfx::Size exp_final_size(initial_wcv_size); 2735 gfx::Size exp_final_size(initial_wcv_size);
2710 exp_final_size.Enlarge(wcv_resize_insets.width(), 2736 exp_final_size.Enlarge(wcv_resize_insets.width(),
2711 wcv_resize_insets.height() + height_inset); 2737 wcv_resize_insets.height() + height_inset);
2712 EXPECT_EQ(exp_final_size, 2738 EXPECT_EQ(exp_final_size,
2713 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2739 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2714 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); 2740 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size());
2715 } 2741 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/alert_dialog.pdf » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698