blob: 940301d8cf625188ccc02cac16ac9d8d99ed54fa [file] [log] [blame]
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function getUIScript()
{
return `
(function() {
uiController.dragFromPointToPoint(50, 250, 50, 30, 0.1, function() {
uiController.uiScriptComplete("Done");
});
})();`
}
function runTest()
{
let output = "";
window.addEventListener("touchstart", function(event) {
event.preventDefault();
output += `touchstart on window - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false });
window.addEventListener("touchmove", function(event) {
event.preventDefault();
output += `touchmove on window - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false, "once": true });
window.addEventListener("touchend", function(event) {
event.preventDefault();
output += `touchend on window - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false });
document.addEventListener("touchstart", function(event) {
event.preventDefault();
output += `touchstart on document - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false });
document.addEventListener("touchmove", function(event) {
event.preventDefault();
output += `touchmove on document - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false, "once": true });
document.addEventListener("touchend", function(event) {
event.preventDefault();
output += `touchend on document - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false });
document.documentElement.addEventListener("touchstart", function(event) {
event.preventDefault();
output += `touchstart on documentElement - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false });
document.documentElement.addEventListener("touchmove", function(event) {
event.preventDefault();
output += `touchmove on documentElement - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false, "once": true });
document.documentElement.addEventListener("touchend", function(event) {
event.preventDefault();
output += `touchend on documentElement - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false });
let body = document.querySelector("body");
body.addEventListener("touchstart", function(event) {
event.preventDefault();
output += `touchstart on body - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false });
body.addEventListener("touchmove", function(event) {
event.preventDefault();
output += `touchmove on body - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false, "once": true });
body.addEventListener("touchend", function(event) {
event.preventDefault();
output += `touchend on body - cancelable: ${event.cancelable} defaultPrevented: ${event.defaultPrevented} <br>`;
}, { "passive": false });
if (testRunner.runUIScript) {
testRunner.runUIScript(getUIScript(), function(result) {
output += result;
document.getElementById("output").innerHTML = output;
testRunner.notifyDone();
});
}
}
window.addEventListener('load', runTest, false);
</script>
<body style="height: 500vh">
<div id=output>
This test requires UIScriptController to run.
</div>
</body>