diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 21:33:23 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-27 21:33:23 +0000 |
commit | c64ec3ae671b19e3c9682acd107ca5d418642a23 (patch) | |
tree | 42ef8fdd8e59b141de937bdedd41e30a84208a0d | |
parent | 15b34389801e2ece5bffd1f9a56a4ea8848d8e6d (diff) | |
download | chromium_src-c64ec3ae671b19e3c9682acd107ca5d418642a23.zip chromium_src-c64ec3ae671b19e3c9682acd107ca5d418642a23.tar.gz chromium_src-c64ec3ae671b19e3c9682acd107ca5d418642a23.tar.bz2 |
NewTabUITest.NTPHasThumbnails can be flakey if it takes more than
2 sec for the history results to be returned (displaying the
thumbnails). Work around this by giving extra time to the test.
BUG=25949
Review URL: http://codereview.chromium.org/339029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30249 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui_uitest.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui_uitest.cc b/chrome/browser/dom_ui/new_tab_ui_uitest.cc index 0a0b4bc..64d1e37 100644 --- a/chrome/browser/dom_ui/new_tab_ui_uitest.cc +++ b/chrome/browser/dom_ui/new_tab_ui_uitest.cc @@ -40,9 +40,17 @@ TEST_F(NewTabUITest, NTPHasThumbnails) { // If all the thumbnails load, there should be no div's with 'filler'. scoped_refptr<TabProxy> tab = window->GetActiveTab(); int filler_thumbnails_count = -1; - ASSERT_TRUE(tab->ExecuteAndExtractInt(L"", - L"window.domAutomationController.send(" - L"document.getElementsByClassName('filler').length)", - &filler_thumbnails_count)); + const int kWaitDuration = 100; + int wait_time = action_max_timeout_ms(); + while (wait_time > 0) { + ASSERT_TRUE(tab->ExecuteAndExtractInt(L"", + L"window.domAutomationController.send(" + L"document.getElementsByClassName('filler').length)", + &filler_thumbnails_count)); + if (filler_thumbnails_count == 0) + break; + PlatformThread::Sleep(kWaitDuration); + wait_time -= kWaitDuration; + } EXPECT_EQ(0, filler_thumbnails_count); } |