summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_uitest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-24 15:52:38 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-24 15:52:38 +0000
commit647a23f1378216d812d840f21b6918cc2b8a2652 (patch)
tree49f43c4d11983535663d49e8d6e7a0d4864bc56f /chrome/browser/browser_uitest.cc
parenta87ecb3c7170caa40810def524fbae1aee4d3533 (diff)
downloadchromium_src-647a23f1378216d812d840f21b6918cc2b8a2652.zip
chromium_src-647a23f1378216d812d840f21b6918cc2b8a2652.tar.gz
chromium_src-647a23f1378216d812d840f21b6918cc2b8a2652.tar.bz2
Make ShowModalDialogTest.BasicTest not flaky and re-enable it.
TEST=Covered by ui_tests. http://crbug.com/17806 Review URL: http://codereview.chromium.org/174245 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_uitest.cc')
-rw-r--r--chrome/browser/browser_uitest.cc28
1 files changed, 12 insertions, 16 deletions
diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc
index 7c99b3a..4c2ed05 100644
--- a/chrome/browser/browser_uitest.cc
+++ b/chrome/browser/browser_uitest.cc
@@ -212,31 +212,27 @@ class ShowModalDialogTest : public UITest {
}
};
-// So flaky, http://crbug.com/17806. Do *not* re-enable without a real fix.
-// Increasing timeouts is not a fix.
-TEST_F(ShowModalDialogTest, DISABLED_BasicTest) {
- // Test that a modal dialog is shown.
+TEST_F(ShowModalDialogTest, BasicTest) {
FilePath test_file(test_data_directory_);
test_file = test_file.AppendASCII("showmodaldialog.html");
+
+ // This navigation should show a modal dialog that will be immediately
+ // closed, but the fact that it was shown should be recorded.
NavigateToURL(net::FilePathToFileURL(test_file));
- ASSERT_TRUE(automation()->WaitForWindowCountToBecome(
- 2, action_max_timeout_ms()));
+ // At this point the modal dialog should not be showing.
+ int window_count = 0;
+ EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count));
+ EXPECT_EQ(1, window_count);
- scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(1);
+ // Verify that we set a mark on successful dialog show.
+ scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0);
+ ASSERT_TRUE(browser.get());
scoped_refptr<TabProxy> tab = browser->GetActiveTab();
ASSERT_TRUE(tab.get());
-
std::wstring title;
ASSERT_TRUE(tab->GetTabTitle(&title));
- ASSERT_EQ(title, L"ModalDialogTitle");
-
- // Test that window.close() works. Since we don't have a way of executing a
- // JS function on the page through TabProxy, reload it and use an unload
- // handler that closes the page.
- ASSERT_EQ(tab->Reload(), AUTOMATION_MSG_NAVIGATION_SUCCESS);
- ASSERT_TRUE(automation()->WaitForWindowCountToBecome(
- 1, action_max_timeout_ms()));
+ ASSERT_EQ(L"SUCCESS", title);
}
#endif