summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-06 02:19:31 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-06 02:19:31 +0000
commit23dd7db09af6da5643e10d839b23d484a5b41eab (patch)
tree8721e1757375d7997c5c5ec4fa35f1227e6e1c22 /chrome/test/pyautolib
parent5a88e5beb6365142e3d0505f3e7cfcf94ba28494 (diff)
downloadchromium_src-23dd7db09af6da5643e10d839b23d484a5b41eab.zip
chromium_src-23dd7db09af6da5643e10d839b23d484a5b41eab.tar.gz
chromium_src-23dd7db09af6da5643e10d839b23d484a5b41eab.tar.bz2
Was already a 'wait for animation to complete'.
Added py interface to it. Review URL: http://codereview.chromium.org/668204 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40812 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r--chrome/test/pyautolib/pyautolib.cc16
-rw-r--r--chrome/test/pyautolib/pyautolib.h5
-rw-r--r--chrome/test/pyautolib/pyautolib.i5
3 files changed, 26 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyautolib.cc b/chrome/test/pyautolib/pyautolib.cc
index 7a9efc9..9f0dd41 100644
--- a/chrome/test/pyautolib/pyautolib.cc
+++ b/chrome/test/pyautolib/pyautolib.cc
@@ -129,3 +129,19 @@ bool PyUITestSuite::GetBookmarkBarVisibility() {
return visible;
}
+bool PyUITestSuite::WaitForBookmarkBarVisibilityChange(bool wait_for_open) {
+ scoped_refptr<BrowserProxy> browser_proxy =
+ automation()->GetBrowserWindow(0); // Window doesn't matter.
+ EXPECT_TRUE(browser_proxy.get());
+ if (!browser_proxy.get())
+ return false;
+
+ // This has a 20sec timeout. If that's not enough we have serious problems.
+ bool completed = UITestBase::WaitForBookmarkBarVisibilityChange(
+ browser_proxy.get(),
+ wait_for_open);
+ EXPECT_TRUE(completed);
+ return completed;
+}
+
+
diff --git a/chrome/test/pyautolib/pyautolib.h b/chrome/test/pyautolib/pyautolib.h
index 0833e2a..b6bb8c3 100644
--- a/chrome/test/pyautolib/pyautolib.h
+++ b/chrome/test/pyautolib/pyautolib.h
@@ -90,6 +90,11 @@ class PyUITestSuite : public UITestSuite, public UITestBase {
// change this return value unexpectedly.
bool IsBookmarkBarAnimating();
+ // Wait for the bookmark bar animation to complete.
+ // If |wait_for_open| is true, wait for it to open.
+ // If |wait_for_open| is false, wait for it to close.
+ bool WaitForBookmarkBarVisibilityChange(bool wait_for_open);
+
private:
base::ScopedNSAutoreleasePool pool_;
};
diff --git a/chrome/test/pyautolib/pyautolib.i b/chrome/test/pyautolib/pyautolib.i
index c406005..f745fbb 100644
--- a/chrome/test/pyautolib/pyautolib.i
+++ b/chrome/test/pyautolib/pyautolib.i
@@ -128,6 +128,11 @@ class PyUITestSuite {
"(to the chrome).") GetBookmarkBarVisibility;
bool GetBookmarkBarVisibility();
+ %feature("docstring", "Wait for the bookmark bar animation to complete. "
+ "|wait_for_open| specifies which kind of change we wait for.")
+ WaitForBookmarkBarVisibilityChange;
+ bool WaitForBookmarkBarVisibilityChange(bool wait_for_open);
+
%feature("docstring", "Open the Find box in the given or first browser "
"window.") OpenFindInPage;
void OpenFindInPage(int window_index=0);