diff options
Diffstat (limited to 'chrome/test/ui')
-rw-r--r-- | chrome/test/ui/ui_test.cc | 8 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 7 |
2 files changed, 14 insertions, 1 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index ec08b65..97d22fa 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -576,6 +576,11 @@ void UITest::NavigateToURLAsync(const GURL& url) { } void UITest::NavigateToURL(const GURL& url) { + NavigateToURLBlockUntilNavigationsComplete(url, 1); +} + +void UITest::NavigateToURLBlockUntilNavigationsComplete( + const GURL& url, int number_of_navigations) { scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); ASSERT_TRUE(tab_proxy.get()); if (!tab_proxy.get()) @@ -583,7 +588,8 @@ void UITest::NavigateToURL(const GURL& url) { bool is_timeout = true; ASSERT_TRUE(tab_proxy->NavigateToURLWithTimeout( - url, command_execution_timeout_ms(), &is_timeout)) << url.spec(); + url, number_of_navigations, command_execution_timeout_ms(), + &is_timeout)) << url.spec(); ASSERT_FALSE(is_timeout) << url.spec(); } diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 50afc27..8568822 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -89,6 +89,13 @@ class UITest : public testing::Test { // This method doesn't return until the navigation is complete. void NavigateToURL(const GURL& url); + // Tells the browser to navigate to the given URL in the active tab + // of the first app window. + // This method doesn't return until the |number_of_navigations| navigations + // complete. + void NavigateToURLBlockUntilNavigationsComplete(const GURL& url, + int number_of_navigations); + // Returns the URL of the currently active tab. Only looks in the first // window, for backward compatibility. If there is no active tab, or some // other error, the returned URL will be empty. |