| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script src="resources/record-events.js"></script> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| window.onload = runTest; |
| |
| function runTest() |
| { |
| if (!window.eventSender) |
| return; |
| |
| var firstInput = document.getElementById("firstInput"); |
| var secondInput = document.getElementById("secondInput"); |
| registerElementsAndEventsToRecord([firstInput, secondInput], ["focus", "blur", "change", "click"]); |
| |
| beginRecordingEvents(); |
| firstInput.focus(); |
| eventSender.keyDown("A"); |
| eventSender.mouseMoveTo(secondInput.offsetLeft, secondInput.offsetTop); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); // Transfers focus to text field "second input". |
| endRecordingEvents(); |
| checkThatEventsFiredInOrder([["firstInput", "focus"], ["firstInput", "change"], ["firstInput", "blur"], ["secondInput", "focus"], ["secondInput", "click"]]); |
| debug('<br /><span class="pass">TEST COMPLETE</span>'); |
| } |
| </script> |
| </head> |
| <body> |
| <p id="description"></p> |
| <div id="test-container"> |
| <input type="text" id="firstInput" placeholder="first input" /> |
| <input type="text" id="secondInput" placeholder="second input" /> |
| </div> |
| <div id="console"></div> |
| <script> |
| description("This test checks that when a user focuses on the "first input" text field, modifies its contents, and then " + |
| "defocuses it by clicking on the "second input" text field that the following DOM events are fired in order: " + |
| "Focus, Change, Blur, Focus (on "second input"), Click (on "second input"). Note, this test must be run by Dump Render Tree."); |
| </script> |
| </body> |
| </html> |