3 <script src=
"../../resources/js-test.js"></script>
4 <script src=
"resources/record-events.js"></script>
7 testRunner
.dumpAsText();
9 window
.onload
= runTest
;
13 if (!window
.eventSender
)
16 var firstInput
= document
.getElementById("firstInput");
17 var secondInput
= document
.getElementById("secondInput");
18 registerElementsAndEventsToRecord([firstInput
, secondInput
], ["focus", "blur", "change", "click"]);
20 beginRecordingEvents();
22 eventSender
.keyDown("A");
23 eventSender
.mouseMoveTo(secondInput
.offsetLeft
, secondInput
.offsetTop
);
24 eventSender
.mouseDown();
25 eventSender
.mouseUp(); // Transfers focus to text field "second input".
27 checkThatEventsFiredInOrder([["firstInput", "focus"], ["firstInput", "change"], ["firstInput", "blur"], ["secondInput", "focus"], ["secondInput", "click"]]);
28 debug('<br /><span class="pass">TEST COMPLETE</span>');
33 <p id=
"description"></p>
34 <div id=
"test-container">
35 <input type=
"text" id=
"firstInput" placeholder=
"first input" />
36 <input type=
"text" id=
"secondInput" placeholder=
"second input" />
38 <div id=
"console"></div>
40 description("This test checks that when a user focuses on the "first input" text field, modifies its contents, and then " +
41 "defocuses it by clicking on the "second input" text field that the following DOM events are fired in order: " +
42 "Focus, Change, Blur, Focus (on "second input"), Click (on "second input"). Note, this test must be run by Dump Render Tree.");