Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / check-defocus-event-order-when-triggered-by-tab.html
blobc15ab62729af79658c714f0af832f967aeb5b76c
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <script src="resources/record-events.js"></script>
5 <script>
6 if (window.testRunner)
7 testRunner.dumpAsText();
9 window.onload = runTest;
11 function runTest()
13 if (!window.eventSender)
14 return;
16 var firstInput = document.getElementById("firstInput");
17 var secondInput = document.getElementById("secondInput");
18 registerElementsAndEventsToRecord([firstInput, secondInput], ["focus", "blur", "change", "click"]);
20 beginRecordingEvents();
21 firstInput.focus();
22 eventSender.keyDown("A");
23 eventSender.keyDown("\t"); // Transfers focus to text field "second input".
24 endRecordingEvents();
25 checkThatEventsFiredInOrder([["firstInput", "focus"], ["firstInput", "change"], ["firstInput", "blur"], ["secondInput", "focus"]]);
26 debug('<br /><span class="pass">TEST COMPLETE</span>');
28 </script>
29 </head>
30 <body>
31 <p id="description"></p>
32 <div id="test-container">
33 <input type="text" id="firstInput" placeholder="first input" />
34 <input type="text" id="secondInput" placeholder="second input" />
35 </div>
36 <div id="console"></div>
37 <script>
38 description("This test checks that when a user focuses on the &quot;first input&quot; text field, modifies its contents, and then " +
39 "defocuses it by pressing the tab key that the following DOM events are fired in order: Focus, Change, Blur, Focus " +
40 "(on &quot;second input&quot;). Note, this test must be run by Dump Render Tree.");
41 </script>
42 </body>
43 </html>