summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib/pyautolib.h
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-23 18:24:19 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-23 18:24:19 +0000
commit3ba3430731e35b3b542872ec90356098ad26fcf2 (patch)
tree33e21a81d1ac7e55cd0aa53dc323595fbf9f218e /chrome/test/pyautolib/pyautolib.h
parent1aef9813f6edaead72c9dfe24ccd07ec525c75b3 (diff)
downloadchromium_src-3ba3430731e35b3b542872ec90356098ad26fcf2.zip
chromium_src-3ba3430731e35b3b542872ec90356098ad26fcf2.tar.gz
chromium_src-3ba3430731e35b3b542872ec90356098ad26fcf2.tar.bz2
PyAuto: Fix some methods that assume that they're working on the first window.
- Provide args to specifiy tab_index or window_index. - Re-order the methods to group by functionality, rather than from where they are implemented. Review URL: http://codereview.chromium.org/650106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib/pyautolib.h')
-rw-r--r--chrome/test/pyautolib/pyautolib.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/chrome/test/pyautolib/pyautolib.h b/chrome/test/pyautolib/pyautolib.h
index 5d1b77c..767b2bd 100644
--- a/chrome/test/pyautolib/pyautolib.h
+++ b/chrome/test/pyautolib/pyautolib.h
@@ -12,6 +12,13 @@
#include "chrome/test/ui/ui_test.h"
#include "chrome/test/ui/ui_test_suite.h"
+// The C++ style guide forbids using default arguments but I'm taking the
+// liberty of allowing it in this file. The sole purpose of this (and the
+// .cc) is to support the python interface, and default args are allowed in
+// python. Strictly adhering to the guide here would mean having to re-define
+// all methods in python just for the sake of providing default args. This
+// seems cumbersome and unwanted.
+
// TODO(nirnimesh): separate out the UITestSuite and UITestBase parts
// crbug.com/32292
@@ -27,15 +34,17 @@ class PyUITestSuite : public UITestSuite, public UITestBase {
virtual void SetUp();
virtual void TearDown();
+ // Navigate to the given URL in the active tab. Blocks until page loaded.
void NavigateToURL(const char* url_string);
- // Get the URL of the active tab.
- GURL GetActiveTabURL();
+ // Navigate to the given URL in given tab in the given window.
+ // Blocks until page loaded.
+ void NavigateToURL(const char* url_string, int window_index, int tab_index);
- // BrowserProxy methods
+ // Get the URL of the active tab.
+ GURL GetActiveTabURL(int window_index = 0);
- // Shows or hides the download shelf.
- void SetShelfVisible(bool is_visible);
+ int GetTabCount(int window_index = 0);
// Appends a new tab with the given URL in the given or first browser window.
bool AppendTab(const GURL& tab_url, int window_index = 0);
@@ -50,14 +59,17 @@ class PyUITestSuite : public UITestSuite, public UITestBase {
// Returns true if the call was successful.
bool ApplyAccelerator(int id, int window_index = 0);
+ // Shows or hides the download shelf.
+ void SetDownloadShelfVisible(bool is_visible, int window_index = 0);
+
// Determines the visibility of the download shelf
- bool IsShelfVisible();
+ bool IsDownloadShelfVisible(int window_index = 0);
// Open the Find box
- void OpenFindInPage();
+ void OpenFindInPage(int window_index = 0);
// Determines the visibility of the Find box
- bool IsFindInPageVisible();
+ bool IsFindInPageVisible(int window_index = 0);
// Get the path to the downloads directory
std::string GetDownloadDirectory();