summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 15:07:18 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 15:07:18 +0000
commit6aa8dcb15ffc65b650eaa201babf19690fbffd57 (patch)
treebaf46b5c8b0008d39e0c92f26dc63dffacbb72f1 /chrome/test/ui
parent63871741d4b48d1a9bf757ffe2a90f85dda711f0 (diff)
downloadchromium_src-6aa8dcb15ffc65b650eaa201babf19690fbffd57.zip
chromium_src-6aa8dcb15ffc65b650eaa201babf19690fbffd57.tar.gz
chromium_src-6aa8dcb15ffc65b650eaa201babf19690fbffd57.tar.bz2
Add automation call to wait for multiple navigations.
Convert one ErrorPage UI test to use it. The rest of the tests will require more work. TEST=Covered by ui_tests. http://crbug.com/19361, http://crbug.com/19395 Review URL: http://codereview.chromium.org/174015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui')
-rw-r--r--chrome/test/ui/ui_test.cc8
-rw-r--r--chrome/test/ui/ui_test.h7
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.