diff options
author | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 17:11:41 +0000 |
---|---|---|
committer | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 17:11:41 +0000 |
commit | 4d420efaaa2bdcb502596ef01ee217d0ea1d0256 (patch) | |
tree | f3b5b727445d14b2948f50fffe5248de2b607264 /chrome/test | |
parent | b0630390c143ce7ad350404bde0e6c7f3e432a4f (diff) | |
download | chromium_src-4d420efaaa2bdcb502596ef01ee217d0ea1d0256.zip chromium_src-4d420efaaa2bdcb502596ef01ee217d0ea1d0256.tar.gz chromium_src-4d420efaaa2bdcb502596ef01ee217d0ea1d0256.tar.bz2 |
BUG=43066
TEST=Download UI tests are much less flaky on build bots.
Review URL: http://codereview.chromium.org/3790010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/ui/ui_test.cc | 30 |
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; } + |