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

Unified Diff: chrome/browser/dom_ui/new_tab_ui_uitest.cc

Issue 339029: NewTabUITest.NTPHasThumbnails can be flakey if it takes more than (Closed)
Patch Set: sleep Created 11 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/new_tab_ui_uitest.cc
diff --git a/chrome/browser/dom_ui/new_tab_ui_uitest.cc b/chrome/browser/dom_ui/new_tab_ui_uitest.cc
index 0a0b4bc5d49ca16f9fd580c48759e86dc295f59d..64d1e370656bdb71985651081df63e348e3e64a9 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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698