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

Unified Diff: third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html

Issue 1964523002: Fix clientX/Y properties of touch pointer events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applying comments Created 4 years, 7 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: third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html
diff --git a/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..5a4f28fe1f60179818202906e033086ba8a93b11
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML>
+<script src='../../../../../resources/js-test.js'></script>
+<style>
+iframe {
+ width: 300px;
+ height: 300px;
+ top: 100px;
+ left: 50px;
+ border: 0;
+ position: absolute;
+ background: green;
+}
+</style>
+<iframe id='target' srcdoc="
+ <body style='height:500px; width: 500px; padding: 0; margin: 0;'>
+ <script>
+ var testEventList = ['pointerup', 'pointerdown', 'pointermove'];
+ testEventList.forEach(function(eventName) {
+ document.documentElement.addEventListener(eventName, function(event) {
+ top.document.events.push(event);
+ });
+ });
+ </script>
+ </body>">
+</iframe>
+
+<div id='console'></div>
+
+<script>
+
+var attributes = [
+ 'clientX',
+ 'clientY'
+];
+
+document.events = [];
+
+function testScenario(scrollX, scrollY, zoomFactor) {
+ document.getElementById('target').contentWindow.scrollTo(scrollX, scrollY);
mustaq 2016/05/10 17:26:16 Please print a test scenario header with the curre
Navid Zolghadr 2016/05/10 17:46:42 Done. I also added the touch event listener to se
+ window.internals.setZoomFactor(zoomFactor);
+
+ // touch events inside iframe
+ eventSender.addTouchPoint(200, 200)
+ eventSender.touchStart();
+ eventSender.updateTouchPoint(0, 200, 200);
+ eventSender.touchMove();
+ eventSender.releaseTouchPoint(0);
+ eventSender.touchEnd();
+
+}
+
+function runTests(scrollX, scrollY) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+
+ testScenario(25, 100, 1);
+ testScenario(40, 140, 1);
+ testScenario(40, 140, 2);
+
+ window.setTimeout('finish()', 0);
+}
+
+function finish()
+{
+ document.events.forEach(function(event) {
+ debug(event.type + " of " + event.pointerType + " is recieved:");
+ attributes.forEach(function(att) {
+ debug(att + " = " + event[att]);
+ });
+ });
+ testRunner.notifyDone();
+}
+
+if (window.eventSender) {
+ window.onload = runTests;
+} else
+ debug('This test requires eventSender');
+
+description("This test verifies clientX/Y of pointer events inside iframe.");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698