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

Unified Diff: chrome/test/ui/ui_test.cc

Issue 115740: Move download shelf from per-tab to per-window (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « chrome/test/ui/ui_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ui_test.cc
===================================================================
--- chrome/test/ui/ui_test.cc (revision 17483)
+++ chrome/test/ui/ui_test.cc (working copy)
@@ -505,16 +505,25 @@
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;
« no previous file with comments | « chrome/test/ui/ui_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698