| <meta name="viewport" content="width=device-width"> |
| <script src="../../../resources/ui-helper.js"></script> |
| testRunner.waitUntilDone(); |
| <body onkeydown="handleKeyDown(event)" onkeyup="handleKeyUp(event)"> |
| <p>This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS for hardware key presses of non-special keys. To run this test manually, verify that two messages are emitted when you press the following keys: <kbd>a</kbd>, <kbd>b</kbd>, <kbd>c</kbd>, <kbd>d</kbd>, <kbd>e</kbd>, <kbd>f</kbd>, <kbd>g</kbd>, <kbd>h</kbd>, <kbd>i</kbd>, <kbd>j</kbd>, <kbd>k</kbd>, <kbd>l</kbd>, <kbd>m</kbd>, <kbd>n</kbd>, <kbd>o</kbd>, <kbd>p</kbd>, <kbd>q</kbd>, <kbd>r</kbd>, <kbd>s</kbd>, <kbd>t</kbd>, <kbd>u</kbd>, <kbd>v</kbd>, <kbd>w</kbd>, <kbd>x</kbd>, <kbd>y</kbd>, <kbd>z</kbd>, <kbd>0</kbd>, <kbd>1</kbd>, <kbd>2</kbd>, <kbd>3</kbd>, <kbd>4</kbd>, <kbd>5</kbd>, <kbd>6</kbd>, <kbd>7</kbd>, <kbd>8</kbd>, <kbd>9</kbd>, <kbd>-</kbd>, <kbd>=</kbd>, <kbd>[</kbd>, <kbd>]</kbd>, <kbd>\</kbd>, <kbd>;</kbd>, <kbd>'</kbd>, <kbd>,</kbd>, <kbd>.</kbd>, <kbd>/</kbd>.</p> |
| const asciiCharacters = "abcdefghijklmnopqrstuvwxyz0123456789-=[]\\;',./".split(""); |
| var remainingKeysToPress = asciiCharacters; |
| async function nextKeyPress() |
| if (!remainingKeysToPress.length) { |
| let nextKey = remainingKeysToPress.shift(); |
| UIHelper.typeCharacter(nextKey); |
| function handleKeyDown(event) |
| function handleKeyUp(event) |
| document.getElementById("console").appendChild(document.createTextNode(message + "\n")); |
| function logKeyEvent(event) |
| for (let propertyName of ["type", "key", "code", "keyIdentifier", "keyCode", "charCode", "keyCode", "which"]) |
| pieces.push(`${propertyName}: ${event[propertyName]}`); |