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

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 78898)
+++ chrome/test/pyautolib/pyauto.py (working copy)
@@ -754,6 +754,33 @@
}
self._GetResultFromJSONRequest(cmd_dict)
+ def SendWebkitKeyEvent(self, key_code, tab_index=0, windex=0):
dennis_jeffrey 2011/03/22 23:28:53 For consistency in naming variables, I recommend t
dyu1 2011/03/24 19:46:51 From the pydocs for pyauto most of the variables f
dennis_jeffrey 2011/03/25 16:56:14 Maybe we should change them all then >:-). Just k
+ """Send a webkit key event to the browser.
+
+ 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)
dennis_jeffrey 2011/03/22 23:28:53 Swap the descriptions for the "windex" and "tab_in
dyu1 2011/03/24 19:46:51 Done.
+ """
+ cmd_dict = {
+ 'command': 'SendWebkitKeyEvent',
+ 'type': 0, # kRawKeyDownType
+ 'text': '',
+ 'isSystemKey': False,
+ 'unmodifiedText': '',
+ 'nativeKeyCode': 0,
+ 'windowsKeyCode': key_code,
+ 'modifiers': 0,
+ 'windex': windex,
+ 'tab_index': tab_index,
+ }
+ # Sending two requests, one each for "key down" and "key up".
+ self._GetResultFromJSONRequest(cmd_dict)
+ cmd_dict['type'] = 3 # kKeyUpType
+ self._GetResultFromJSONRequest(cmd_dict)
+
def WaitForAllDownloadsToComplete(self, windex=0):
"""Wait for all downloads to complete.

Powered by Google App Engine
This is Rietveld 408576698