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

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

Issue 8587004: Add PyAuto tests for triggering browser/page action. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Ken's comments Created 9 years, 1 month 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
Index: chrome/test/pyautolib/pyauto.py
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index 9e179f6d7b74b87ca637ab356482d42ee5dc60f9..e5e4e8586396e19239585ffaf5cfa7845b9680ef 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -1468,6 +1468,9 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
u'incognito': False,
u'profile_path': u'Default',
u'fullscreen': False,
+ u'visible_page_actions':
+ [u'dgcoklnmbeljaehamekjpeidmbicddfj',
+ u'osfcklnfasdofpcldmalwpicslasdfgd']
u'selected_tab': 0,
u'tabs': [ {
u'index': 0,
@@ -1790,6 +1793,38 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
}
self._GetResultFromJSONRequest(cmd_dict)
+ def TriggerPageActionById(self, id, windex=0):
+ """Trigger page action asynchronously in the active tab.
+
+ The page action icon must be displayed before invoking this function.
+
+ Args:
+ id: The string id of the extension.
+ windex: Integer index of the browser window to use; defaults to 0
+ (first window).
+ """
+ cmd_dict = { # Prepare command for the json interface
+ 'command': 'TriggerPageActionById',
+ 'id': id,
+ 'windex': windex,
+ }
+ self._GetResultFromJSONRequest(cmd_dict, windex=windex)
+
+ def TriggerBrowserActionById(self, id, windex=0):
+ """Trigger browser action asynchronously in the active tab.
+
+ Args:
+ id: The string id of the extension.
+ windex: Integer index of the browser window to use; defaults to 0
+ (first window).
+ """
+ cmd_dict = { # Prepare command for the json interface
+ 'command': 'TriggerBrowserActionById',
+ 'id': id,
+ 'windex': windex,
+ }
+ self._GetResultFromJSONRequest(cmd_dict, windex=windex)
+
def UpdateExtensionsNow(self):
"""Auto-updates installed extensions.
@@ -1820,6 +1855,8 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
extension_id: (optional) ID of the extension.
url: (optional) URL of the extension view.
view_type: (optional) Type of the extension view.
+ [EXTENSION_BACKGROUND_PAGE|EXTENSION_POPUP|EXTENSION_INFOBAR|
+ EXTENSION_DIALOG]
dennis_jeffrey 2011/11/23 21:54:54 Should these be strings?
Returns:
The 'view' property of the extension view.
« chrome/test/functional/extensions.py ('K') | « chrome/test/functional/extensions.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698