Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 window.addEventListener("touchstart", logEvent); | 6 function setupAndRunTest() { |
| 7 window.addEventListener("touchend", logEvent); | 7 var content = document.getElementById("content"); |
| 8 window.addEventListener("touchmove", logEvent); | 8 content.addEventListener("touchstart", logEvent); |
|
Rick Byers
2016/07/07 20:02:09
any reason to change the target instead of making
dtapuska
2016/07/07 20:34:21
Again; trying to future proof it but I don't have
| |
| 9 window.addEventListener("touchcancel", logEvent); | 9 content.addEventListener("touchend", logEvent); |
| 10 content.addEventListener("touchmove", logEvent); | |
| 11 content.addEventListener("touchcancel", logEvent); | |
| 12 runTest(); | |
| 13 } | |
| 10 | 14 |
| 11 function logEvent(event) | 15 function logEvent(event) |
| 12 { | 16 { |
| 13 event.preventDefault(); | 17 event.preventDefault(); |
| 14 log("-----Event-----"); | 18 log("-----Event-----"); |
| 15 log("type: " + event.type); | 19 log("type: " + event.type); |
| 16 if (event.shiftKey) | 20 if (event.shiftKey) |
| 17 log("shiftKey"); | 21 log("shiftKey"); |
| 18 log("----Touches----"); | 22 log("----Touches----"); |
| 19 for (var i = 0; i < event.touches.length; i++) { | 23 for (var i = 0; i < event.touches.length; i++) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 InspectorTest.completeTest(); | 122 InspectorTest.completeTest(); |
| 119 } | 123 } |
| 120 | 124 |
| 121 InspectorTest.sendCommand("Page.enable", {}, function() { | 125 InspectorTest.sendCommand("Page.enable", {}, function() { |
| 122 InspectorTest.sendCommand("Page.setTouchEmulationEnabled", { enabled: tr ue }, sendNextEvent); | 126 InspectorTest.sendCommand("Page.setTouchEmulationEnabled", { enabled: tr ue }, sendNextEvent); |
| 123 }); | 127 }); |
| 124 } | 128 } |
| 125 | 129 |
| 126 </script> | 130 </script> |
| 127 </head> | 131 </head> |
| 128 <body onload="runTest()"> | 132 <body onload="setupAndRunTest()"> |
| 133 <div style="width: 100%; height: 100%" id="content"> | |
| 134 </div> | |
| 129 </body> | 135 </body> |
| 130 </html> | 136 </html> |
| OLD | NEW |