Chromium Code Reviews| Index: LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html |
| diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html |
| similarity index 64% |
| copy from LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html |
| copy to LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html |
| index 90b80d3ad44684aabc31b818a9fbeb504a062937..24aa3c22fb871f6d3dc04489dfacb45e238f29c8 100644 |
| --- a/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html |
| +++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html |
| @@ -7,41 +7,38 @@ html, body { |
| body { |
| height: 1000px; |
| } |
| -#target { |
| - width: 50px; |
| - height: 50px; |
| -} |
| </style> |
| -<iframe frameborder=0 id="target" src="resources/event-delegator.html"></iframe> |
| <div id=console></div> |
| <script> |
| var event; |
| -window.scrollTo(0, 3); |
| -var rect = target.getBoundingClientRect(); |
| +var scrollOffset = 42; |
| +window.scrollTo(0, scrollOffset); |
| var point = { |
| - x: rect.left + rect.width / 2, |
| - y: rect.top + rect.height / 2 - 3 |
| + x: 50, |
| + y: 50 |
| }; |
| var eventReceived = {}; |
| function onEventInFrame(e) { |
|
Rick Byers
2014/10/10 00:39:35
nit: just call this onEvent (onEventInFrame is a s
Zeeshan Qureshi
2014/10/10 00:47:23
oops, missed updating this.
|
| - debug("Received " + e.type + " in child frame"); |
| + debug("Received " + e.type + " in page"); |
| event = e; |
| eventReceived[e.type] = true; |
| shouldBe("event.screenX", "point.x"); |
| shouldBe("event.screenY", "point.y"); |
| - shouldBe("event.clientX", "50 / 2"); |
| - shouldBe("event.clientY", "50 / 2 + 7"); |
| + shouldBe("event.clientX", "point.x"); |
| + shouldBe("event.clientY", "point.y"); |
| } |
| -description("Verifies that a tap occuring in a scrolled iframe has the correct co-ordinates"); |
| +var eventTypes = ['mousemove', 'mousedown', 'mouseup', 'click']; |
| +for (var i = 0; i < eventTypes.length; i++) |
| + document.addEventListener(eventTypes[i],onEventInFrame); |
| + |
| +description("Verifies that a tap occuring in a scrolled page has the correct co-ordinates"); |
| if (window.eventSender) { |
| jsTestIsAsync = true; |
| - target.onload = function() { |
| - target.contentWindow.scrollTo(0, 7); |
| - |
| + window.onload = function() { |
| debug("Sending GestureTapDown to " + point.x + "," + point.y); |
| eventSender.gestureTapDown(point.x, point.y); |