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

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
« no previous file with comments | « chrome/test/functional/autofill_dataset_generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyauto.py
===================================================================
--- chrome/test/pyautolib/pyauto.py (revision 79302)
+++ 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):
+ """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).
+ tab_index: tab index to work on. Defaults to 0 (first tab)
+ windex: window index to work on. Defaults to 0 (first window)
+ """
+ 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.
« no previous file with comments | « chrome/test/functional/autofill_dataset_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698