diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 14:39:56 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-07 14:39:56 +0000 |
commit | c90e135d0a9097774779813189f4bcea0f16ce91 (patch) | |
tree | f96ea8df306d0abaee8adcb8e1d6385a416229d2 /chrome/browser/download/download_uitest.cc | |
parent | 55a9a102a879355d95376c28a566e46fbcfe7e65 (diff) | |
download | chromium_src-c90e135d0a9097774779813189f4bcea0f16ce91.zip chromium_src-c90e135d0a9097774779813189f4bcea0f16ce91.tar.gz chromium_src-c90e135d0a9097774779813189f4bcea0f16ce91.tar.bz2 |
Revert 46681 - Add AutomationMsg_WaitForDownloadShelfVisibilityChange and use it in UITestBase for the download tests.
This should decrease flakiness of download tests.
TEST=DownloadTest.*, especially DownloadTest.[Dont]CloseNewTab*
BUG=43066
Review URL: http://codereview.chromium.org/1933005
TBR=bauerb@chromium.org
Review URL: http://codereview.chromium.org/2037003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46685 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_uitest.cc')
-rw-r--r-- | chrome/browser/download/download_uitest.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/chrome/browser/download/download_uitest.cc b/chrome/browser/download/download_uitest.cc index 011a54c..b8171fa 100644 --- a/chrome/browser/download/download_uitest.cc +++ b/chrome/browser/download/download_uitest.cc @@ -112,7 +112,7 @@ class DownloadTest : public UITest { // TODO(tc): check download status text // Make sure the download shelf is showing. - EXPECT_TRUE(window->WaitForDownloadShelfVisibilityChange(true)); + EXPECT_TRUE(WaitForDownloadShelfVisible(window.get())); } FilePath filename; @@ -187,7 +187,7 @@ TEST_F(DownloadTest, FLAKY_DownloadMimeType) { scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); - EXPECT_TRUE(browser->WaitForDownloadShelfVisibilityChange(true)); + EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get())); } // Access a file with a viewable mime-type, verify that a download @@ -213,7 +213,7 @@ TEST_F(DownloadTest, FLAKY_NoDownload) { scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); - EXPECT_FALSE(browser->WaitForDownloadShelfVisibilityChange(true)); + EXPECT_FALSE(WaitForDownloadShelfVisible(browser.get())); } // Download a 0-size file with a content-disposition header, verify that the @@ -233,7 +233,7 @@ TEST_F(DownloadTest, FLAKY_ContentDisposition) { // Ensure the download shelf is visible on the window. scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); - EXPECT_TRUE(browser->WaitForDownloadShelfVisibilityChange(true)); + EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get())); } // Test that the download shelf is per-window by starting a download in one @@ -254,7 +254,7 @@ TEST_F(DownloadTest, FLAKY_PerWindowShelf) { // Ensure the download shelf is visible on the window. scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); - EXPECT_TRUE(browser->WaitForDownloadShelfVisibilityChange(true)); + EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get())); // Open a second tab ASSERT_TRUE(browser->AppendTab(GURL())); @@ -262,7 +262,7 @@ TEST_F(DownloadTest, FLAKY_PerWindowShelf) { // Hide shelf EXPECT_TRUE(browser->SetShelfVisible(false)); - EXPECT_TRUE(browser->WaitForDownloadShelfVisibilityChange(false)); + EXPECT_TRUE(WaitForDownloadShelfInvisible(browser.get())); // Go to first tab EXPECT_TRUE(browser->ActivateTab(0)); @@ -336,7 +336,7 @@ TEST_F(DownloadTest, FLAKY_IncognitoDownload) { ASSERT_TRUE(tab->NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(file))); // Verify that the download shelf is showing for the Incognito window. - EXPECT_TRUE(incognito->WaitForDownloadShelfVisibilityChange(true)); + EXPECT_TRUE(WaitForDownloadShelfVisible(incognito.get())); // Close the Incognito window and don't crash. ASSERT_TRUE(incognito->RunCommand(IDC_CLOSE_WINDOW)); @@ -385,9 +385,8 @@ TEST_F(DownloadTest, FLAKY_CloseNewTab1) { ASSERT_TRUE(tab_proxy->NavigateToURLAsyncWithDisposition( URLRequestMockHTTPJob::GetMockUrl(file), NEW_BACKGROUND_TAB)); - // When the download starts, we should still have one tab. - ASSERT_TRUE(browser->WaitForDownloadShelfVisibilityChange(true)); + ASSERT_TRUE(WaitForDownloadShelfVisible(browser)); EXPECT_EQ(1, GetTabCount()); CheckDownload(file); @@ -411,7 +410,7 @@ TEST_F(DownloadTest, FLAKY_DontCloseNewTab2) { FilePath file(FILE_PATH_LITERAL("download-test1.lib")); ASSERT_TRUE(tab_proxy->NavigateToURLAsync(GURL("javascript:openNew()"))); - ASSERT_TRUE(browser->WaitForDownloadShelfVisibilityChange(true)); + ASSERT_TRUE(WaitForDownloadShelfVisible(browser)); EXPECT_EQ(2, GetTabCount()); CheckDownload(file); @@ -438,7 +437,7 @@ TEST_F(DownloadTest, FLAKY_DontCloseNewTab3) { ASSERT_TRUE(tab_proxy->NavigateToURLAsync( URLRequestMockHTTPJob::GetMockUrl(file))); - ASSERT_TRUE(browser->WaitForDownloadShelfVisibilityChange(true)); + ASSERT_TRUE(WaitForDownloadShelfVisible(browser)); EXPECT_EQ(2, GetTabCount()); CheckDownload(file); @@ -462,7 +461,7 @@ TEST_F(DownloadTest, FLAKY_CloseNewTab2) { FilePath file(FILE_PATH_LITERAL("download-test1.lib")); ASSERT_TRUE(tab_proxy->NavigateToURLAsync(GURL("javascript:openNew()"))); - ASSERT_TRUE(browser->WaitForDownloadShelfVisibilityChange(true)); + ASSERT_TRUE(WaitForDownloadShelfVisible(browser)); EXPECT_EQ(1, GetTabCount()); CheckDownload(file); @@ -487,7 +486,7 @@ TEST_F(DownloadTest, FLAKY_CloseNewTab3) { ASSERT_TRUE(tab_proxy->NavigateToURLAsync( GURL("javascript:document.getElementById('form').submit()"))); - ASSERT_TRUE(browser->WaitForDownloadShelfVisibilityChange(true)); + ASSERT_TRUE(WaitForDownloadShelfVisible(browser)); EXPECT_EQ(1, GetTabCount()); CheckDownload(file); |