| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>InputEvent: beforeinput inputType</title> | 4 <title>InputEvent: beforeinput inputType</title> |
| 5 <script src="../../../resources/testharness.js"></script> | 5 <script src="../../../resources/testharness.js"></script> |
| 6 <script src="../../../resources/testharnessreport.js"></script> | 6 <script src="../../../resources/testharnessreport.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <input type="text" id="txt"> | 9 <input type="text" id="txt"> |
| 10 <script> | 10 <script> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 lastInputType = kNoInputEventFired; | 31 lastInputType = kNoInputEventFired; |
| 32 eventSender.keyDown(key, modifiers); | 32 eventSender.keyDown(key, modifiers); |
| 33 assert_equals(lastBeforeInputType, inputType, `${modifiers.toString(
)}+${key} should produce beforeInputType: ${inputType}`); | 33 assert_equals(lastBeforeInputType, inputType, `${modifiers.toString(
)}+${key} should produce beforeInputType: ${inputType}`); |
| 34 assert_equals(lastInputType, inputType, `${modifiers.toString()}+${k
ey} should produce inputType: ${inputType}`); | 34 assert_equals(lastInputType, inputType, `${modifiers.toString()}+${k
ey} should produce inputType: ${inputType}`); |
| 35 } | 35 } |
| 36 | 36 |
| 37 txt.focus(); | 37 txt.focus(); |
| 38 // Typing | 38 // Typing |
| 39 testKeyDownInputType('a', [], 'insertText'); | 39 testKeyDownInputType('a', [], 'insertText'); |
| 40 testKeyDownInputType('6', [], 'insertText'); | 40 testKeyDownInputType('6', [], 'insertText'); |
| 41 testKeyDownInputType('backspace', [], 'deleteContent'); | 41 testKeyDownInputType('Backspace', [], 'deleteContent'); |
| 42 testKeyDownInputType('l', ['shiftKey'], 'insertText'); | 42 testKeyDownInputType('l', ['shiftKey'], 'insertText'); |
| 43 testKeyDownInputType('w', ['shiftKey'], 'insertText'); | 43 testKeyDownInputType('w', ['shiftKey'], 'insertText'); |
| 44 | 44 |
| 45 // Keyboard commands | 45 // Keyboard commands |
| 46 var isMacOS = (navigator.userAgent.indexOf('Mac OS X') != -1); | 46 var isMacOS = (navigator.userAgent.indexOf('Mac OS X') != -1); |
| 47 if (!isMacOS) { | 47 if (!isMacOS) { |
| 48 // MacOS's eventSender does not work on hot keys other than arrows. | 48 // MacOS's eventSender does not work on hot keys other than arrows. |
| 49 testKeyDownInputType('z', ['ctrlKey'], 'undo'); | 49 testKeyDownInputType('z', ['ctrlKey'], 'undo'); |
| 50 testKeyDownInputType('z', ['ctrlKey', 'shiftKey'], 'redo'); | 50 testKeyDownInputType('z', ['ctrlKey', 'shiftKey'], 'redo'); |
| 51 } | 51 } |
| 52 // Move command should not generate input events. | 52 // Move command should not generate input events. |
| 53 testKeyDownInputType('leftArrow', [], kNoInputEventFired); | 53 testKeyDownInputType('ArrowLeft', [], kNoInputEventFired); |
| 54 testKeyDownInputType('leftArrow', ['shiftKey'], kNoInputEventFired); | 54 testKeyDownInputType('ArrowLeft', ['shiftKey'], kNoInputEventFired); |
| 55 testKeyDownInputType('home', [], kNoInputEventFired); | 55 testKeyDownInputType('Home', [], kNoInputEventFired); |
| 56 } | 56 } |
| 57 }, 'Testing beforeinput inputType'); | 57 }, 'Testing beforeinput inputType'); |
| 58 </script> | 58 </script> |
| 59 </body> | 59 </body> |
| 60 </html> | 60 </html> |
| OLD | NEW |