Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / keydown-function-keys.html
blob790b779232f9c8f77afe399ceda8ba25a993c2e5
1 <html>
2 <head>
3 <title>Event Test (Sending function-key events)</title>
4 <script language="javascript" type="text/javascript">
5 function log(str) {
6 var li = document.createElement("li");
7 li.appendChild(document.createTextNode(str));
8 var console = document.getElementById("console");
9 console.appendChild(li);
11 function onKeyEvent(ev) {
12 ev = ev || event;
13 log('Type=' + ev.type + ',' +
14 'keyCode=' + (ev.which || ev.keyCode) + ',' +
15 'ctrlKey=' + ev.ctrlKey + ',' +
16 'shiftKey=' + ev.shiftKey + ',' +
17 'altKey=' + ev.altKey + ',' +
18 'metaKey=' + ev.metaKey);
20 </script>
21 </head>
22 <body>
23 <p>This test verifies the keycodes sent when we press function keys.</p>
24 <textarea id="test" rows="1" cols="40" onkeydown="return onKeyEvent(event);" onkeyup="return onKeyEvent(event);"></textarea>
25 <ul id="console"></ul>
26 <script language="javascript" type="text/javascript">
27 if (window.testRunner)
28 window.testRunner.dumpAsText();
29 var textarea = document.getElementById("test");
30 textarea.focus();
31 eventSender.keyDown("F1");
32 eventSender.keyDown("F2");
33 eventSender.keyDown("F3");
34 eventSender.keyDown("F4");
35 eventSender.keyDown("F5");
36 eventSender.keyDown("F6");
37 eventSender.keyDown("F7");
38 eventSender.keyDown("F8");
39 eventSender.keyDown("F9");
40 eventSender.keyDown("F10");
41 eventSender.keyDown("F11");
42 eventSender.keyDown("F12");
43 </script>
44 </body>
45 </html>