2 <script src=
"../../../../resources/js-test.js"></script>
3 <script src=
"../resources/touch-hover-active-tests.js"></script>
4 <link rel=
"stylesheet" href=
"../resources/touch-hover-active-tests.css">
26 background-color: lightblue;
34 <div id=target class=touch-interactive
></div>
36 <div id=fakeTarget class=touch-interactive
></div>
39 <div id=console
></div>
43 description("Verifies that the element receiving the :active style is the same as the element receiving the click event, even in the presence of difficult touch adjustment scenarios");
46 document
.addEventListener('click', function(e
) {
48 testFailed('Saw unexpected duplicate click event');
49 clickTarget
= e
.target
;
52 var rect
= target
.getBoundingClientRect();
53 var x
= rect
.left
+ rect
.width
/ 2;
54 var y
= rect
.top
+ rect
.height
/ 2;
56 debug('Sending gestureTapDown');
57 eventSender
.gestureTapDown(x
, y
, 30, 30);
58 shouldBeDefault('getHoverActiveState(target)');
60 debug('Sending gestureShowPress');
61 eventSender
.gestureShowPress(x
, y
, 30, 30);
62 shouldBeHoveredAndActive('getHoverActiveState(target)');
64 debug('Sending gestureTap');
65 eventSender
.gestureTap(x
, y
, 1, 30, 30);
66 shouldBeEqualToString("clickTarget.id", "target");