OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/protocol-test.js"></script> |
4 <script> | 4 <script> |
5 | 5 |
6 window.addEventListener("keydown", logEvent); | 6 window.addEventListener("keydown", logEvent); |
7 window.addEventListener("keypress", logEvent); | 7 window.addEventListener("keypress", logEvent); |
8 window.addEventListener("keyup", logEvent); | 8 window.addEventListener("keyup", logEvent); |
9 | 9 |
10 function logEvent(event) | 10 function logEvent(event) |
(...skipping 18 matching lines...) Expand all Loading... |
29 log("text: " + event.text); | 29 log("text: " + event.text); |
30 log(""); | 30 log(""); |
31 } | 31 } |
32 | 32 |
33 function test() | 33 function test() |
34 { | 34 { |
35 var events = [ | 35 var events = [ |
36 { | 36 { |
37 "type": "rawKeyDown", | 37 "type": "rawKeyDown", |
38 "windowsVirtualKeyCode": 65, // VK_A | 38 "windowsVirtualKeyCode": 65, // VK_A |
39 "keyIdentifier": "U+0041", | 39 "keyIdentifier": "U+0041" |
40 }, | 40 }, |
41 { | 41 { |
42 "type": "char", | 42 "type": "char", |
43 "modifiers": 8, // shift | 43 "modifiers": 8, // shift |
44 "text": "A", | 44 "text": "A", |
45 "unmodifiedText": "a", | 45 "unmodifiedText": "a" |
46 }, | 46 }, |
47 { | 47 { |
48 "type": "keyUp", | 48 "type": "keyUp", |
49 "windowsVirtualKeyCode": 65, | 49 "windowsVirtualKeyCode": 65, |
50 "keyIdentifier": "U+0041" | 50 "keyIdentifier": "U+0041" |
| 51 }, |
| 52 { |
| 53 "type": "char", |
| 54 "text": "\u05E9", // Hebrew Shin (sh) |
| 55 "unmodifiedText": "\u05E9" |
51 } | 56 } |
52 ]; | 57 ]; |
53 | 58 |
54 for (var i = 0; i < events.length; i++) | 59 for (var i = 0; i < events.length; i++) |
55 InspectorTest.sendCommand("Input.dispatchKeyEvent", events[i], checkResp
onse.bind(undefined, i == events.length - 1)); | 60 InspectorTest.sendCommand("Input.dispatchKeyEvent", events[i], checkResp
onse.bind(undefined, i == events.length - 1)); |
56 | 61 |
57 function checkResponse(isLastCommand, msg) | 62 function checkResponse(isLastCommand, msg) |
58 { | 63 { |
59 if (msg.error) | 64 if (msg.error) |
60 InspectorTest.log("Error: " + msg.error.message); | 65 InspectorTest.log("Error: " + msg.error.message); |
61 if (isLastCommand) | 66 if (isLastCommand) |
62 InspectorTest.completeTest(); | 67 InspectorTest.completeTest(); |
63 } | 68 } |
64 } | 69 } |
65 | 70 |
66 </script> | 71 </script> |
67 </head> | 72 </head> |
68 <body onload="runTest()"> | 73 <body onload="runTest()"> |
69 </body> | 74 </body> |
70 </html> | 75 </html> |
OLD | NEW |