| 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..fd7dbb384e6925a00044fd8f241100397d53eb5b
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html
|
| @@ -0,0 +1,91 @@
|
| +<!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',
|
| + 'touchstart', 'touchmove', 'touchend'];
|
| + 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) {
|
| + debug('===== scrollX=' + scrollX + ', scrollY=' + scrollY + ', zoomFactor=' + zoomFactor);
|
| +
|
| + document.getElementById('target').contentWindow.scrollTo(scrollX, scrollY);
|
| + 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();
|
| +
|
| + dumpEvents();
|
| + debug('');
|
| +}
|
| +
|
| +function runTests(scrollX, scrollY) {
|
| + testScenario(25, 100, 1);
|
| + testScenario(40, 140, 1);
|
| + testScenario(40, 140, 2);
|
| +
|
| + testRunner.notifyDone();
|
| +}
|
| +
|
| +function dumpEvents()
|
| +{
|
| + document.events.forEach(function(event) {
|
| + if (event.type.startsWith('pointer')) {
|
| + debug(event.type + " of " + event.pointerType + " is recieved:");
|
| + attributes.forEach(function(att) {
|
| + debug(att + " = " + event[att]);
|
| + });
|
| + } else if (event.type.startsWith('touch')) {
|
| + debug(event.type + " is recieved:");
|
| + attributes.forEach(function(att) {
|
| + debug(att + " = " + event.changedTouches[0][att]);
|
| + });
|
| + }
|
| + });
|
| + document.events = [];
|
| +}
|
| +
|
| +if (window.eventSender) {
|
| + testRunner.waitUntilDone();
|
| + window.onload = runTests;
|
| +} else
|
| + debug('This test requires eventSender');
|
| +
|
| +description("This test verifies clientX/Y of pointer events inside iframe.");
|
| +
|
| +</script>
|
|
|