summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/ui/ui_test.cc30
1 files changed, 26 insertions, 4 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index b7a7c5a..fcbec1a 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -1137,20 +1137,42 @@ bool UITest::WaitForFindWindowVisibilityChange(BrowserProxy* browser,
bool UITest::WaitForDownloadShelfVisibilityChange(BrowserProxy* browser,
bool wait_for_open) {
const int kCycles = 10;
+ int fail_count = 0;
+ int incorrect_state_count = 0;
+ base::Time start = base::Time::Now();
for (int i = 0; i < kCycles; i++) {
// Give it a chance to catch up.
bool browser_survived = CrashAwareSleep(sleep_timeout_ms() / kCycles);
EXPECT_TRUE(browser_survived);
- if (!browser_survived)
+ if (!browser_survived) {
+ LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF()
+ << " seconds"
+ << " call failed " << fail_count << " times"
+ << " state was incorrect " << incorrect_state_count << " times";
+ ADD_FAILURE() << "Browser failed in " << __FUNCTION__;
return false;
+ }
bool visible = !wait_for_open;
- if (!browser->IsShelfVisible(&visible))
+ if (!browser->IsShelfVisible(&visible)) {
+ fail_count++;
continue;
- if (visible == wait_for_open)
+ }
+ if (visible == wait_for_open) {
+ LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF()
+ << " seconds"
+ << " call failed " << fail_count << " times"
+ << " state was incorrect " << incorrect_state_count << " times";
return true; // Got the download shelf.
+ }
+ incorrect_state_count++;
}
- ADD_FAILURE() << "Timeout reached in WaitForDownloadShelfVisibilityChange";
+ LOG(INFO) << "Elapsed time: " << (base::Time::Now() - start).InSecondsF()
+ << " seconds"
+ << " call failed " << fail_count << " times"
+ << " state was incorrect " << incorrect_state_count << " times";
+ ADD_FAILURE() << "Timeout reached in " << __FUNCTION__;
return false;
}
+