OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
4 <script> | 4 <script> |
5 | 5 |
6 function load() | 6 function load() |
7 { | 7 { |
8 window.internals.setFocused(false); | 8 window.internals.setFocused(false); |
9 runTest(); | 9 runTest(); |
10 } | 10 } |
(...skipping 16 matching lines...) Expand all Loading... |
27 InspectorTest.evaluateInPage("dump()", InspectorTest.completeTest.bind(Inspe
ctorTest)); | 27 InspectorTest.evaluateInPage("dump()", InspectorTest.completeTest.bind(Inspe
ctorTest)); |
28 | 28 |
29 function type(text) | 29 function type(text) |
30 { | 30 { |
31 for (var i = 0; i < text.length; ++i) { | 31 for (var i = 0; i < text.length; ++i) { |
32 var dec = text.charCodeAt(i); | 32 var dec = text.charCodeAt(i); |
33 var hex = "U+00" + Number(dec).toString(16); | 33 var hex = "U+00" + Number(dec).toString(16); |
34 InspectorTest.sendCommand("Input.dispatchKeyEvent", { | 34 InspectorTest.sendCommand("Input.dispatchKeyEvent", { |
35 "type": "rawKeyDown", | 35 "type": "rawKeyDown", |
36 "windowsVirtualKeyCode": dec, | 36 "windowsVirtualKeyCode": dec, |
37 "keyIdentifier": hex | 37 "key": text[i] |
38 }); | 38 }); |
39 InspectorTest.sendCommand("Input.dispatchKeyEvent", { | 39 InspectorTest.sendCommand("Input.dispatchKeyEvent", { |
40 "type": "char", | 40 "type": "char", |
41 "text": text[i], | 41 "text": text[i], |
| 42 "key": text[i], |
42 "unmodifiedText": text[i] | 43 "unmodifiedText": text[i] |
43 }); | 44 }); |
44 InspectorTest.sendCommand("Input.dispatchKeyEvent", { | 45 InspectorTest.sendCommand("Input.dispatchKeyEvent", { |
45 "type": "keyUp", | 46 "type": "keyUp", |
46 "windowsVirtualKeyCode": dec, | 47 "windowsVirtualKeyCode": dec, |
47 "keyIdentifier": hex | 48 "key": text[i] |
48 }); | 49 }); |
49 } | 50 } |
50 } | 51 } |
51 | 52 |
52 function typeTab() | 53 function typeTab() |
53 { | 54 { |
54 InspectorTest.sendCommand("Input.dispatchKeyEvent", { | 55 InspectorTest.sendCommand("Input.dispatchKeyEvent", { |
55 "type": "rawKeyDown", | 56 "type": "rawKeyDown", |
56 "windowsVirtualKeyCode": 9, | 57 "windowsVirtualKeyCode": 9, |
57 "keyIdentifier": "U+0009", | |
58 "key": "Tab", | 58 "key": "Tab", |
59 }); | 59 }); |
60 InspectorTest.sendCommand("Input.dispatchKeyEvent", { | 60 InspectorTest.sendCommand("Input.dispatchKeyEvent", { |
61 "type": "char" | |
62 }); | |
63 InspectorTest.sendCommand("Input.dispatchKeyEvent", { | |
64 "type": "keyUp", | 61 "type": "keyUp", |
65 "windowsVirtualKeyCode": 9, | 62 "windowsVirtualKeyCode": 9, |
66 "keyIdentifier": "U+0009", | |
67 "key": "Tab", | 63 "key": "Tab", |
68 }); | 64 }); |
69 } | 65 } |
70 } | 66 } |
71 | 67 |
72 </script> | 68 </script> |
73 </head> | 69 </head> |
74 <body onload="load()"> | 70 <body onload="load()"> |
75 <div id="inputs"> | 71 <div id="inputs"> |
76 <input onfocus="log('focus foo')" onblur="log('blur foo')" id="foo" autofocus> | 72 <input onfocus="log('focus foo')" onblur="log('blur foo')" id="foo" autofocus> |
77 <input onfocus="log('focus bar')" onblur="log('blur bar')" id="bar"> | 73 <input onfocus="log('focus bar')" onblur="log('blur bar')" id="bar"> |
78 <input onfocus="log('focus baz')" onblur="log('blur baz')" id="baz"> | 74 <input onfocus="log('focus baz')" onblur="log('blur baz')" id="baz"> |
79 </div> | 75 </div> |
80 </body> | 76 </body> |
81 </html> | 77 </html> |
OLD | NEW |