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

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

Issue 6685077: Two sets of Autofill tests.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 9 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
Index: chrome/test/pyautolib/pyauto.py
===================================================================
--- chrome/test/pyautolib/pyauto.py (revision 78641)
+++ chrome/test/pyautolib/pyauto.py (working copy)
@@ -754,6 +754,32 @@
}
self._GetResultFromJSONRequest(cmd_dict)
+ def SendKeyEvent(self, key_code, windex=0, tab_index=0):
Nirnimesh 2011/03/18 03:53:29 s/SendKeyEvent/SendWebkitKeyEvent/ to distinguish
Nirnimesh 2011/03/18 03:53:29 Put tab_index arg before windex
dyu1 2011/03/18 20:59:00 Done.
dyu1 2011/03/18 20:59:00 Done.
+ """Send a key event to the browser.
Nirnimesh 2011/03/18 03:53:29 Update this description accordingly
dyu1 2011/03/18 20:59:00 Done.
+
+ Used to simulate key presses from the keyboard to interact with the browser.
+
+ Args:
+ key_code: the hex value associated with the keypress (virtual key code).
+ windex: window index to work on. Defaults to 0 (first window)
+ tab_index: tab index to work on. Defaults to 0 (first tab)
+ """
+ cmd_dict = {
+ 'command': 'SendWebkitKeyEvent',
+ 'type': 0, # kRawKeyDownType
Nirnimesh 2011/03/18 03:53:29 need 2 spaces before #
dyu1 2011/03/18 20:59:00 Done.
+ 'text': '',
+ 'isSystemKey': False,
+ 'unmodifiedText': '',
+ 'nativeKeyCode': 0,
+ 'windowsKeyCode': key_code,
+ 'modifiers': 0,
+ 'windex': windex,
+ 'tab_index': tab_index,
+ }
+ self._GetResultFromJSONRequest(cmd_dict)
+ cmd_dict['type'] = 3 # kKeyUpType
Nirnimesh 2011/03/18 03:53:29 need at least 2 spaces before #
Nirnimesh 2011/03/18 03:53:29 modifying cmd_dict after calling _GetResultFromJSO
dyu1 2011/03/18 20:59:00 Done.
dyu1 2011/03/18 20:59:00 I actually need both since the cmd_dict is two sep
dennis_jeffrey 2011/03/18 21:44:01 Unless I'm mistaken, I think David's actually send
dyu1 2011/03/21 18:42:35 Done.
+ self._GetResultFromJSONRequest(cmd_dict)
+
def WaitForAllDownloadsToComplete(self, windex=0):
"""Wait for all downloads to complete.

Powered by Google App Engine
This is Rietveld 408576698