Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Unified Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled.html

Issue 641063003: Pass correct client coordinates for mouse events synthesized from a GestureTap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test output Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698