summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 18:46:24 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 18:46:24 +0000
commit3eb7c16a5e8699ea75a449ef98f19b87f0d716de (patch)
tree7bb6d7f2a73e9c25f3025070a1857c52ae8ffcde /chrome/test/pyautolib
parent2fe06ba6aa71943b9f7a0ac7b602cb5eefbd93c9 (diff)
downloadchromium_src-3eb7c16a5e8699ea75a449ef98f19b87f0d716de.zip
chromium_src-3eb7c16a5e8699ea75a449ef98f19b87f0d716de.tar.gz
chromium_src-3eb7c16a5e8699ea75a449ef98f19b87f0d716de.tar.bz2
Add pyauto tests for Navigation.
Review URL: http://codereview.chromium.org/1948002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r--chrome/test/pyautolib/pyautolib.cc6
-rw-r--r--chrome/test/pyautolib/pyautolib.h3
-rw-r--r--chrome/test/pyautolib/pyautolib.i4
3 files changed, 13 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyautolib.cc b/chrome/test/pyautolib/pyautolib.cc
index fab3832..452727b 100644
--- a/chrome/test/pyautolib/pyautolib.cc
+++ b/chrome/test/pyautolib/pyautolib.cc
@@ -156,6 +156,12 @@ bool PyUITestBase::OpenNewBrowserWindow(bool show) {
return automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, show);
}
+int PyUITestBase::GetBrowserWindowCount() {
+ int num_windows = 0;
+ EXPECT_TRUE(automation()->GetBrowserWindowCount(&num_windows));
+ return num_windows;
+}
+
bool PyUITestBase::InstallExtension(const FilePath& crx_file, bool with_ui) {
scoped_refptr<ExtensionProxy> proxy =
automation()->InstallExtension(crx_file, with_ui);
diff --git a/chrome/test/pyautolib/pyautolib.h b/chrome/test/pyautolib/pyautolib.h
index 321cfde..d293370 100644
--- a/chrome/test/pyautolib/pyautolib.h
+++ b/chrome/test/pyautolib/pyautolib.h
@@ -98,6 +98,9 @@ class PyUITestBase : public UITestBase {
// Open a new browser window. Returns false on failure.
bool OpenNewBrowserWindow(bool show);
+ // Fetch the number of browser windows. Includes popups.
+ int GetBrowserWindowCount();
+
// Installs the extension crx. Returns true only if extension was installed
// and loaded successfully. Overinstalls will fail.
bool InstallExtension(const FilePath& crx_file, bool with_ui);
diff --git a/chrome/test/pyautolib/pyautolib.i b/chrome/test/pyautolib/pyautolib.i
index 626303f..63ec51f 100644
--- a/chrome/test/pyautolib/pyautolib.i
+++ b/chrome/test/pyautolib/pyautolib.i
@@ -276,6 +276,10 @@ class PyUITestBase {
%feature("docstring", "Open a new browser window.") OpenNewBrowserWindow;
bool OpenNewBrowserWindow(bool show);
+ %feature("docstring", "Fetch the number of browser windows. Includes popups.")
+ GetBrowserWindowCount;
+ int GetBrowserWindowCount();
+
%feature("docstring", "Get the index of the active tab in the given or "
"first window. Indexes are zero-based.") GetActiveTabIndex;
int GetActiveTabIndex(int window_index=0);