| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 description("Checks that KeyboardEvent.location is DOM_KEY_LOCATION_STANDARD for
NumLock key."); | 8 description("Checks that KeyboardEvent.location is DOM_KEY_LOCATION_STANDARD for
NumLock key."); |
| 9 | 9 |
| 10 var lastKeyboardEvent = null; | 10 var lastKeyboardEvent = null; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 var textarea = document.createElement("textarea"); | 27 var textarea = document.createElement("textarea"); |
| 28 textarea.addEventListener("keydown", recordKeyEvent, false); | 28 textarea.addEventListener("keydown", recordKeyEvent, false); |
| 29 document.body.insertBefore(textarea, document.body.firstChild); | 29 document.body.insertBefore(textarea, document.body.firstChild); |
| 30 textarea.focus(); | 30 textarea.focus(); |
| 31 | 31 |
| 32 var VKEY_NUMLOCK = 0x90; | 32 var VKEY_NUMLOCK = 0x90; |
| 33 | 33 |
| 34 if (window.eventSender) { | 34 if (window.eventSender) { |
| 35 eventSender.keyDown("numLock"); | 35 eventSender.keyDown("NumLock"); |
| 36 shouldBeEqualToString("lastKeyboardEvent.type", "keydown"); | 36 shouldBeEqualToString("lastKeyboardEvent.type", "keydown"); |
| 37 shouldBe("lastKeyboardEvent.keyCode", "VKEY_NUMLOCK"); | 37 shouldBe("lastKeyboardEvent.keyCode", "VKEY_NUMLOCK"); |
| 38 shouldBe("lastKeyboardEvent.location", "KeyboardEvent.DOM_KEY_LOCATION_STAND
ARD"); | 38 shouldBe("lastKeyboardEvent.location", "KeyboardEvent.DOM_KEY_LOCATION_STAND
ARD"); |
| 39 } else { | 39 } else { |
| 40 debug("This test needs window.eventSender to run."); | 40 debug("This test needs window.eventSender to run."); |
| 41 } | 41 } |
| 42 | 42 |
| 43 </script> | 43 </script> |
| 44 </body> | 44 </body> |
| 45 </html> | 45 </html> |
| OLD | NEW |