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

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

Issue 429793004: Re-add extra hit-tests on GestureTap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix patch Created 6 years, 5 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-frame-scrolled.html
diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html
new file mode 100644
index 0000000000000000000000000000000000000000..90b80d3ad44684aabc31b818a9fbeb504a062937
--- /dev/null
+++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled.html
@@ -0,0 +1,63 @@
+<!DOCTYPE HTML>
+<script src="../../../../resources/js-test.js"></script>
+<style>
+html, body {
+ margin: 0;
+}
+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 point = {
+ x: rect.left + rect.width / 2,
+ y: rect.top + rect.height / 2 - 3
+};
+
+var eventReceived = {};
+
+function onEventInFrame(e) {
+ debug("Received " + e.type + " in child frame");
+ 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");
+}
+
+description("Verifies that a tap occuring in a scrolled iframe has the correct co-ordinates");
+
+if (window.eventSender) {
+ jsTestIsAsync = true;
+ target.onload = function() {
+ target.contentWindow.scrollTo(0, 7);
+
+ debug("Sending GestureTapDown to " + point.x + "," + point.y);
+ eventSender.gestureTapDown(point.x, point.y);
+
+ debug("Sending GestureShowPress");
+ eventSender.gestureShowPress(point.x, point.y);
+
+ debug("Sending GestureTap");
+ eventSender.gestureTap(point.x, point.y);
+
+ shouldBeTrue("eventReceived.mousemove");
+ shouldBeTrue("eventReceived.mousedown");
+ shouldBeTrue("eventReceived.mouseup");
+ shouldBeTrue("eventReceived.click");
+ setTimeout(finishJSTest, 100);
+ }
+} else {
+ debug("This test requires eventSender");
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698