2 <script src=
"../../resources/js-test.js"></script>
23 <div id=
"inner"></div>
26 <div id=
"console"></div>
29 description("Verifies that dragging mouse in/out of an element doesn't fire redundant mouseenter or mouseleave events (crbug.com/470258)");
34 ["outer", "inner"].forEach(function(id
) {
35 wasInside
[id
] = false;
37 var targetDiv
= document
.getElementById(id
);
39 targetDiv
.addEventListener("mouseenter", function(event
) {
40 debug(id
+ " received mouseenter");
41 shouldBeFalse("wasInside['" + id
+ "']");
45 targetDiv
.addEventListener("mouseleave", function(event
) {
46 debug(id
+ " received mouseleave");
47 shouldBeTrue("wasInside['" + id
+ "']");
48 wasInside
[id
] = false;
51 targetDiv
.addEventListener("mousedown", function(event
) {
52 debug(id
+ " received mousedown");
55 targetDiv
.addEventListener("mouseup", function(event
) {
56 debug(id
+ " received mouseup");
62 if (window
.eventSender
) {
63 eventSender
.mouseMoveTo(1, 150);
65 eventSender
.mouseMoveTo(110, 150);
66 eventSender
.mouseDown();
68 eventSender
.mouseMoveTo(140, 150);
69 eventSender
.mouseMoveTo(150, 150);
70 eventSender
.mouseMoveTo(160, 150);
72 eventSender
.mouseMoveTo(190, 150);
73 eventSender
.mouseUp();
75 eventSender
.mouseMoveTo(201, 150);
77 debug("This test requires eventSender");