Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <script src='../../../../../resources/js-test.js'></script> | |
| 3 <style> | |
| 4 iframe { | |
| 5 width: 300px; | |
| 6 height: 300px; | |
| 7 margin-left: 100px; | |
| 8 margin-top: 30px; | |
| 9 border: 0; | |
| 10 background: green; | |
| 11 } | |
| 12 </style> | |
| 13 <iframe id='target' srcdoc=" | |
| 14 <body style='height:500px; padding: 0; margin: 0;'> | |
| 15 | |
| 16 <script> | |
| 17 var testEventList = ['pointerup', 'pointerdown', 'pointermove', | |
| 18 '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
| |
| 19 | |
| 20 testEventList.forEach(function(eventName) { | |
| 21 document.documentElement.addEventListener(eventName, function(event) { | |
| 22 top.document.events.push(event); | |
| 23 }); | |
| 24 }); | |
| 25 | |
| 26 </script></body>"></iframe> | |
| 27 | |
| 28 <div id='console'></div> | |
| 29 | |
| 30 <script> | |
| 31 | |
| 32 var attributes = [ | |
| 33 'clientX', | |
| 34 'clientY' | |
| 35 ]; | |
| 36 | |
| 37 document.events = []; | |
| 38 | |
| 39 function runTests() { | |
| 40 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.
| |
| 41 testRunner.dumpAsText(); | |
| 42 testRunner.waitUntilDone(); | |
| 43 | |
| 44 // touch events inside iframe | |
| 45 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
| |
| 46 eventSender.touchStart(); | |
| 47 eventSender.updateTouchPoint(0, 200, 200); | |
| 48 eventSender.touchMove(); | |
| 49 eventSender.releaseTouchPoint(0); | |
| 50 eventSender.touchEnd(); | |
| 51 | |
| 52 window.setTimeout('finish()', 0); | |
| 53 } | |
| 54 | |
| 55 function finish() | |
| 56 { | |
| 57 document.events.forEach(function(event) { | |
| 58 debug(event.type + " of " + event.pointerType + " is recieved:"); | |
| 59 attributes.forEach(function(att) { | |
| 60 debug(att + " = " + event[att]); | |
| 61 }); | |
| 62 }); | |
| 63 testRunner.notifyDone(); | |
| 64 } | |
| 65 | |
| 66 if (window.eventSender) { | |
| 67 window.onload = runTests; | |
| 68 } else | |
| 69 debug('This test requires eventSender'); | |
| 70 | |
| 71 description("This test verifies clientX/Y of pointer events inside iframe."); | |
| 72 | |
| 73 </script> | |
| OLD | NEW |