Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2382)

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 10836015: Convert more automation calls to the JSON interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some failing tests. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/functional/themes.py ('k') | chrome/test/pyautolib/pyautolib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyauto.py
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index b056bd536fe277ec471a231bbf5ba639a3468363..4308fad831debd36fea864946b0c9a172387569a 100755
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -1270,6 +1270,51 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
}
self._GetResultFromJSONRequest(cmd_dict, windex=None)
+ def GetBrowserWindowCount(self):
+ """Get the browser window count.
+
+ Args:
+ None.
+
+ Returns:
+ Integer count of the number of browser windows. Includes popups.
+
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = {'command': 'GetBrowserWindowCount'}
+ return self._GetResultFromJSONRequest(cmd_dict, windex=None)['count']
+
+ def OpenNewBrowserWindow(self, show):
+ """Create a new browser window.
+
+ Args:
+ show: Boolean indicating whether to show the window.
+
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = {
+ 'command': 'OpenNewBrowserWindow',
+ 'show': show,
+ }
+ self._GetResultFromJSONRequest(cmd_dict, windex=None)
+
+ def CloseBrowserWindow(self, windex=0):
+ """Create a new browser window.
+
+ Args:
+ windex: Index of the browser window to close; defaults to 0.
+
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = {
+ 'command': 'CloseBrowserWindow',
+ 'windex': windex,
+ }
+ self._GetResultFromJSONRequest(cmd_dict, windex=None)
+
def AppendTab(self, url, windex=0):
"""Append a new tab.
@@ -3205,6 +3250,21 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
}
self._GetResultFromJSONRequest(cmd_dict, windex=windex)
+ def ResetToDefaultTheme(self, windex=0):
+ """Reset to default theme.
+
+ Args:
+ windex: Index of the window to reset; defaults to 0.
+
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = {
+ 'command': 'ResetToDefaultTheme',
+ 'windex': windex,
+ }
+ self._GetResultFromJSONRequest(cmd_dict, windex=None)
+
def SetTheme(self, crx_file_path, windex=0):
"""Installs the given theme synchronously.
@@ -3406,6 +3466,40 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
return self._GetResultFromJSONRequest(cmd_dict, windex=windex,
timeout=timeout)
+ def OpenFindInPage(self, windex=0):
+ """Opens the "Find in Page" box.
+
+ Args:
+ windex: Index of the window; defaults to 0.
+
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = {
+ 'command': 'OpenFindInPage',
+ 'windex' : windex,
+ }
+ self._GetResultFromJSONRequest(cmd_dict, windex=None)
+
+ def IsFindInPageVisible(self, windex=0):
+ """Returns the visibility of the "Find in Page" box.
+
+ Args:
+ windex: Index of the window; defaults to 0.
+
+ Returns:
+ A boolean indicating the visibility state of the "Find in Page" box.
+
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = {
+ 'command': 'IsFindInPageVisible',
+ 'windex' : windex,
+ }
+ return self._GetResultFromJSONRequest(cmd_dict, windex=None)['is_visible']
+
+
def AddDomEventObserver(self, event_name='', automation_id=-1,
recurring=False):
"""Adds a DomEventObserver associated with the AutomationEventQueue.
« no previous file with comments | « chrome/test/functional/themes.py ('k') | chrome/test/pyautolib/pyautolib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698