| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <script src="../../../../resources/js-test-pre.js"></script> |
| <style> |
| body { |
| margin: none; |
| } |
| </style> |
| <meta name="viewport" content="initial-scale=1"> |
| </head> |
| <body> |
| <p id="description"></p> |
| <div id="console"> |
| </div> |
| <script> |
| description("Test that Apple Pencil moves are captured."); |
| window.jsTestIsAsync = true; |
| |
| function getUIScript(x, y) |
| { |
| return ` |
| (function() { |
| uiController.stylusDownAtPoint(${x}, ${y}, 0, 0, 0, function () {}); |
| uiController.stylusMoveToPoint(${x + 10}, ${y + 10}, 0, 0, 0, function () {}); |
| uiController.stylusUpAtPoint(${x + 10}, ${y + 10}, function () {}); |
| })();` |
| } |
| |
| function runTest() |
| { |
| window.addEventListener("touchstart", (event) => { |
| debug("touchstart fired."); |
| }); |
| |
| window.addEventListener("touchmove", (event) => { |
| debug("touchmove fired."); |
| }); |
| |
| window.addEventListener("touchend", (event) => { |
| debug("touchend fired."); |
| finishJSTest(); |
| }); |
| |
| if (window.testRunner) |
| testRunner.runUIScript(getUIScript(50, 200), function(result) { }); |
| } |
| |
| window.addEventListener("load", runTest, false); |
| </script> |
| <script src="../../../../resources/js-test-post.js"></script> |
| </body> |
| </html> |