Chromium Code Reviews| 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. |