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

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

Issue 174015: Add automation call to wait for multiple navigations. (Closed)
Patch Set: backwards compatibility, properly done Created 11 years, 4 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 | « chrome/test/automation/tab_proxy.h ('k') | chrome/test/memory_test/memory_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/tab_proxy.cc
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index 6ee36a28b7a5a1f4d13002d60bfff3dede457b7e..3d21d8f09f79f732db5d9f4c96244ce7a3410a0a 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -71,19 +71,38 @@ int TabProxy::FindInPage(const std::wstring& search_string,
AutomationMsg_NavigationResponseValues TabProxy::NavigateToURL(
const GURL& url) {
- return NavigateToURLWithTimeout(url, base::kNoTimeout, NULL);
+ return NavigateToURLBlockUntilNavigationsComplete(url, 1);
+}
+
+AutomationMsg_NavigationResponseValues
+ TabProxy::NavigateToURLBlockUntilNavigationsComplete(
+ const GURL& url, int number_of_navigations) {
+ return NavigateToURLWithTimeout(url, number_of_navigations, base::kNoTimeout,
+ NULL);
}
AutomationMsg_NavigationResponseValues TabProxy::NavigateToURLWithTimeout(
- const GURL& url, uint32 timeout_ms, bool* is_timeout) {
+ const GURL& url, int number_of_navigations, uint32 timeout_ms,
+ bool* is_timeout) {
if (!is_valid())
return AUTOMATION_MSG_NAVIGATION_ERROR;
AutomationMsg_NavigationResponseValues navigate_response =
AUTOMATION_MSG_NAVIGATION_ERROR;
- sender_->SendWithTimeout(new AutomationMsg_NavigateToURL(
- 0, handle_, url, &navigate_response), timeout_ms, is_timeout);
+ if (number_of_navigations == 1) {
+ // TODO(phajdan.jr): Remove when the reference build gets updated.
+ // This is only for backwards compatibility.
+ sender_->SendWithTimeout(
+ new AutomationMsg_NavigateToURL(
+ 0, handle_, url, &navigate_response),
+ timeout_ms, is_timeout);
+ } else {
+ sender_->SendWithTimeout(
+ new AutomationMsg_NavigateToURLBlockUntilNavigationsComplete(
+ 0, handle_, url, number_of_navigations, &navigate_response),
+ timeout_ms, is_timeout);
+ }
return navigate_response;
}
« no previous file with comments | « chrome/test/automation/tab_proxy.h ('k') | chrome/test/memory_test/memory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698