summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib/pyautolib.cc
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.cc
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.cc')
-rw-r--r--chrome/test/pyautolib/pyautolib.cc40
1 files changed, 27 insertions, 13 deletions
diff --git a/chrome/test/pyautolib/pyautolib.cc b/chrome/test/pyautolib/pyautolib.cc
index 8465e39..ebfb565 100644
--- a/chrome/test/pyautolib/pyautolib.cc
+++ b/chrome/test/pyautolib/pyautolib.cc
@@ -30,32 +30,40 @@ void PyUITestSuite::NavigateToURL(const char* url_string) {
UITestBase::NavigateToURL(url);
}
+void PyUITestSuite::NavigateToURL(
+ const char* url_string, int window_index, int tab_index) {
+ GURL url(url_string);
+ UITestBase::NavigateToURL(url, window_index, tab_index);
+}
+
bool PyUITestSuite::AppendTab(const GURL& tab_url, int window_index) {
scoped_refptr<BrowserProxy> browser_proxy =
- automation()->GetBrowserWindow(window_index);
+ automation()->GetBrowserWindow(window_index);
return browser_proxy->AppendTab(tab_url);
}
bool PyUITestSuite::ApplyAccelerator(int id, int window_index) {
scoped_refptr<BrowserProxy> browser_proxy =
- automation()->GetBrowserWindow(window_index);
+ automation()->GetBrowserWindow(window_index);
return browser_proxy->ApplyAccelerator(id);
}
bool PyUITestSuite::ActivateTab(int tab_index, int window_index) {
scoped_refptr<BrowserProxy> browser_proxy =
- automation()->GetBrowserWindow(window_index);
+ automation()->GetBrowserWindow(window_index);
return browser_proxy->ActivateTab(tab_index);
}
-void PyUITestSuite::SetShelfVisible(bool is_visible) {
- scoped_refptr<BrowserProxy> browser_proxy = automation()->GetBrowserWindow(0);
+void PyUITestSuite::SetDownloadShelfVisible(bool is_visible, int window_index) {
+ scoped_refptr<BrowserProxy> browser_proxy =
+ automation()->GetBrowserWindow(window_index);
ASSERT_TRUE(browser_proxy.get());
EXPECT_TRUE(browser_proxy->SetShelfVisible(is_visible));
}
-bool PyUITestSuite::IsShelfVisible() {
- scoped_refptr<BrowserProxy> browser_proxy = automation()->GetBrowserWindow(0);
+bool PyUITestSuite::IsDownloadShelfVisible(int window_index) {
+ scoped_refptr<BrowserProxy> browser_proxy =
+ automation()->GetBrowserWindow(window_index);
EXPECT_TRUE(browser_proxy.get());
if (!browser_proxy.get())
return false;
@@ -64,18 +72,24 @@ bool PyUITestSuite::IsShelfVisible() {
return visible;
}
-GURL PyUITestSuite::GetActiveTabURL() {
- return UITestBase::GetActiveTabURL();
+int PyUITestSuite::GetTabCount(int window_index) {
+ return UITestBase::GetTabCount(window_index);
}
-void PyUITestSuite::OpenFindInPage() {
- scoped_refptr<BrowserProxy> browser_proxy = automation()->GetBrowserWindow(0);
+GURL PyUITestSuite::GetActiveTabURL(int window_index) {
+ return UITestBase::GetActiveTabURL(window_index);
+}
+
+void PyUITestSuite::OpenFindInPage(int window_index) {
+ scoped_refptr<BrowserProxy> browser_proxy =
+ automation()->GetBrowserWindow(window_index);
ASSERT_TRUE(browser_proxy.get());
EXPECT_TRUE(browser_proxy->OpenFindInPage());
}
-bool PyUITestSuite::IsFindInPageVisible() {
- scoped_refptr<BrowserProxy> browser_proxy = automation()->GetBrowserWindow(0);
+bool PyUITestSuite::IsFindInPageVisible(int window_index) {
+ scoped_refptr<BrowserProxy> browser_proxy =
+ automation()->GetBrowserWindow(window_index);
EXPECT_TRUE(browser_proxy.get());
if (!browser_proxy.get())
return false;