diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 03:30:22 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 03:30:22 +0000 |
commit | 59560e0ba999d5edc33453d4a0fbf44831025817 (patch) | |
tree | f365944f6f0eca593a28747a7fed4caf169578fb /chrome/test/ui | |
parent | 4d2868972ff25746d39ecea58e88480ae0463145 (diff) | |
download | chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.zip chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.tar.gz chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.tar.bz2 |
Move download shelf from per-tab to per-window. Also disable auto-hiding of
the shelf.
BUG=9025
TEST=Download file in one tab, open new tab, and check that download shelf is
still open. Also try the shelf's close button and the "show all downloads"
link. When saving a file, the download animation should not show up.
Review URL: http://codereview.chromium.org/115740
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui')
-rw-r--r-- | chrome/test/ui/ui_test.cc | 17 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 20 |
2 files changed, 29 insertions, 8 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index c6b1574..c081207 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -505,16 +505,25 @@ void UITest::NavigateToURL(const GURL& url) { ASSERT_FALSE(is_timeout) << url.spec(); } -bool UITest::WaitForDownloadShelfVisible(TabProxy* tab) { +bool UITest::WaitForDownloadShelfVisible(BrowserProxy* browser) { + return WaitForDownloadShelfVisibilityChange(browser, true); +} + +bool UITest::WaitForDownloadShelfInvisible(BrowserProxy* browser) { + return WaitForDownloadShelfVisibilityChange(browser, false); +} + +bool UITest::WaitForDownloadShelfVisibilityChange(BrowserProxy* browser, + bool wait_for_open) { const int kCycles = 10; for (int i = 0; i < kCycles; i++) { // Give it a chance to catch up. PlatformThread::Sleep(sleep_timeout_ms() / kCycles); - bool visible = false; - if (!tab->IsShelfVisible(&visible)) + bool visible = !wait_for_open; + if (!browser->IsShelfVisible(&visible)) continue; - if (visible) + if (visible == wait_for_open) return true; // Got the download shelf. } return false; diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 69e3c507..4d778a6 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -172,10 +172,22 @@ class UITest : public testing::Test { // assert that the tab count is valid at the end of the wait. void WaitUntilTabCount(int tab_count); - // Checks whether the download shelf is visible in the current tab, giving it - // a chance to appear (we don't know the exact timing) while finishing as soon - // as possible. - bool WaitForDownloadShelfVisible(TabProxy* tab); + // Checks whether the download shelf is visible in the current browser, giving + // it a chance to appear (we don't know the exact timing) while finishing as + // soon as possible. + bool WaitForDownloadShelfVisible(BrowserProxy* browser); + + // Checks whether the download shelf is invisible in the current browser, + // giving it a chance to appear (we don't know the exact timing) while + // finishing as soon as possible. + bool WaitForDownloadShelfInvisible(BrowserProxy* browser); + + private: + // Waits for download shelf visibility or invisibility. + bool WaitForDownloadShelfVisibilityChange(BrowserProxy* browser, + bool wait_for_open); + + public: // Waits until the Find window has become fully visible (if |wait_for_open| is // true) or fully hidden (if |wait_for_open| is false). This function can time |