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

Unified Diff: chrome/test/automation/automation_proxy.cc

Issue 39257: Add regression test for bug 7900 and necessary infrastructure.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 11 years, 10 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
Index: chrome/test/automation/automation_proxy.cc
===================================================================
--- chrome/test/automation/automation_proxy.cc (revision 11106)
+++ chrome/test/automation/automation_proxy.cc (working copy)
@@ -343,6 +343,42 @@
}
#endif // defined(OS_WIN)
+bool AutomationProxy::WaitForURLDisplayed(GURL url, int wait_timeout) {
+ const TimeTicks start = TimeTicks::Now();
+ const TimeDelta timeout = TimeDelta::FromMilliseconds(wait_timeout);
+ while (TimeTicks::Now() - start < timeout) {
+ int window_count;
+ if (!GetBrowserWindowCount(&window_count))
+ return false;
+
+ for (int i = 0; i < window_count; i++) {
+ BrowserProxy* window = GetBrowserWindow(i);
+ if (!window)
+ break;
+
+ int tab_count;
+ if (!window->GetTabCount(&tab_count))
+ continue;
+
+ for (int j = 0; j < tab_count; j++) {
+ TabProxy* tab = window->GetTab(j);
+ if (!tab)
+ break;
+
+ GURL tab_url;
+ if (!tab->GetCurrentURL(&tab_url))
+ continue;
+
+ if (tab_url == url)
+ return true;
+ }
+ }
+ PlatformThread::Sleep(automation::kSleepTime);
+ }
+
+ return false;
+}
+
bool AutomationProxy::SetFilteredInet(bool enabled) {
return Send(new AutomationMsg_SetFilteredInet(0, enabled));
}
« chrome/app/chrome_main_uitest.cc ('K') | « chrome/test/automation/automation_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698