Chromium Code Reviews| 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..c63569d67271fb08bdeb8bdef3910d965a4ddab2 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/virtual/pointerevent/fast/events/pointerevents/pointer-event-properties-in-iframe.html |
| @@ -0,0 +1,73 @@ |
| +<!DOCTYPE HTML> |
| +<script src='../../../../../resources/js-test.js'></script> |
| +<style> |
| +iframe { |
| + width: 300px; |
| + height: 300px; |
| + margin-left: 100px; |
| + margin-top: 30px; |
| + border: 0; |
| + background: green; |
| +} |
| +</style> |
| +<iframe id='target' srcdoc=" |
| +<body style='height:500px; padding: 0; margin: 0;'> |
| + |
| +<script> |
| +var testEventList = ['pointerup', 'pointerdown', 'pointermove', |
| + 'mouseup', 'mousedown', 'mousemove',]; |
|
bokan
2016/05/09 18:13:08
For my own understanding, why aren't the mouseup|d
Navid Zolghadr
2016/05/09 18:59:04
I needed them for my future change which I'm going
|
| + |
| +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 runTests() { |
| + document.getElementById('target').contentWindow.scrollTo(0, 100); |
|
mustaq
2016/05/09 18:16:50
Can we test the same event sequence at two differe
Navid Zolghadr
2016/05/09 18:59:04
Done.
|
| + testRunner.dumpAsText(); |
| + testRunner.waitUntilDone(); |
| + |
| + // touch events inside iframe |
| + eventSender.addTouchPoint(200, 200) |
|
bokan
2016/05/09 18:13:08
Please add a test that's a clone of this but with
Navid Zolghadr
2016/05/09 18:59:04
I added one but I was not sure what the result sho
|
| + eventSender.touchStart(); |
| + eventSender.updateTouchPoint(0, 200, 200); |
| + eventSender.touchMove(); |
| + eventSender.releaseTouchPoint(0); |
| + eventSender.touchEnd(); |
| + |
| + 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> |