4 <script src=
"../../resources/js-test.js"></script>
6 <body onload=
"runTest()">
7 <input type=
"text" id=
"src">
8 <input type=
"text" id=
"dst">
9 <div id=
"console"></div>
11 description("This test verifies that content of input box could be restored in 'focus' event fired by drag-and-drop.");
17 var src
= document
.getElementById('src');
19 var dst
= document
.getElementById('dst');
21 function restoreValue()
26 dst
.addEventListener("focus", restoreValue
, false);
29 eventSender
.mouseMoveTo(src
.offsetLeft
+ src
.offsetWidth
/ 2, src
.offsetTop
+ src
.offsetHeight
/ 2);
30 eventSender
.mouseDown();
31 eventSender
.leapForward(1000);
32 eventSender
.mouseMoveTo(dst
.offsetLeft
+ dst
.offsetWidth
/ 2, dst
.offsetTop
+ dst
.offsetHeight
/ 2);
33 eventSender
.mouseUp();
35 shouldBeEqualToString("oldValue", "");
36 shouldBeEqualToString("src.value", "abc");
37 shouldBeEqualToString("dst.value", "abc");