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

Side by Side 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, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/ui/ui_test.h" 5 #include "chrome/test/ui/ui_test.h"
6 6
7 #include "chrome/app/chrome_dll_resource.h" 7 #include "chrome/app/chrome_dll_resource.h"
8 #include "chrome/test/automation/browser_proxy.h" 8 #include "chrome/test/automation/browser_proxy.h"
9 #include "chrome/test/automation/tab_proxy.h" 9 #include "chrome/test/automation/tab_proxy.h"
10 #include "chrome/test/automation/window_proxy.h" 10 #include "chrome/test/automation/window_proxy.h"
(...skipping 22 matching lines...) Expand all
33 // Bring up a new tab page. 33 // Bring up a new tab page.
34 window->ApplyAccelerator(IDC_NEW_TAB); 34 window->ApplyAccelerator(IDC_NEW_TAB);
35 WaitUntilTabCount(2); 35 WaitUntilTabCount(2);
36 int load_time; 36 int load_time;
37 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); 37 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time));
38 38
39 // Blank thumbnails on the NTP have the class 'filler' applied to the div. 39 // Blank thumbnails on the NTP have the class 'filler' applied to the div.
40 // If all the thumbnails load, there should be no div's with 'filler'. 40 // If all the thumbnails load, there should be no div's with 'filler'.
41 scoped_refptr<TabProxy> tab = window->GetActiveTab(); 41 scoped_refptr<TabProxy> tab = window->GetActiveTab();
42 int filler_thumbnails_count = -1; 42 int filler_thumbnails_count = -1;
43 ASSERT_TRUE(tab->ExecuteAndExtractInt(L"", 43 const int kWaitDuration = 100;
44 L"window.domAutomationController.send(" 44 int wait_time = action_max_timeout_ms();
45 L"document.getElementsByClassName('filler').length)", 45 while (wait_time > 0) {
46 &filler_thumbnails_count)); 46 ASSERT_TRUE(tab->ExecuteAndExtractInt(L"",
47 L"window.domAutomationController.send("
48 L"document.getElementsByClassName('filler').length)",
49 &filler_thumbnails_count));
50 if (filler_thumbnails_count == 0)
51 break;
52 PlatformThread::Sleep(kWaitDuration);
53 wait_time -= kWaitDuration;
54 }
47 EXPECT_EQ(0, filler_thumbnails_count); 55 EXPECT_EQ(0, filler_thumbnails_count);
48 } 56 }
OLDNEW
« 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