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

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

Issue 201153003: Revert 252883 "Remove tests and code for showModalDialog" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | chrome/test/data/showmodaldialog.html » ('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 49a5837bcc3d751281e2b9c52e910e72c1c60fa6..930e4e330553049b0a539dc488f27020a011cdc0 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -2040,6 +2040,30 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, FullscreenBookmarkBar) {
}
#endif
+class ShowModalDialogTest : public BrowserTest {
+ public:
+ ShowModalDialogTest() {}
+
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+ command_line->AppendSwitch(switches::kDisablePopupBlocking);
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(ShowModalDialogTest, BasicTest) {
+ // This navigation should show a modal dialog that will be immediately
+ // closed, but the fact that it was shown should be recorded.
+ GURL url = ui_test_utils::GetTestUrl(
+ base::FilePath(), base::FilePath().AppendASCII("showmodaldialog.html"));
+
+ base::string16 expected_title(ASCIIToUTF16("SUCCESS"));
+ content::TitleWatcher title_watcher(
+ browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ // Verify that we set a mark on successful dialog show.
+ ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle());
+}
+
IN_PROC_BROWSER_TEST_F(BrowserTest, DisallowFileUrlUniversalAccessTest) {
GURL url = ui_test_utils::GetTestUrl(
base::FilePath(),
« no previous file with comments | « no previous file | chrome/test/data/showmodaldialog.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698