blob: 203c8f78a6970bb278af63b5aac3c2cf390e670e [file] [log] [blame]
<!DOCTYPE html>
<body onload="test()">
This test checks that a long press gesture on an file input button does not crash on iOS.
Press and hold on the file input button below until you see the word "PASS".
<p id="result">Test not running</p>
<input type="file" id="filecontrol">
var timer;
var pass;
function setText(s)
document.getElementById("result").innerHTML = s;
function test() {
var input = document.getElementById("filecontrol");
input.onclick = function(e) { e.preventDefault(); }
input.ontouchstart = function() {
passed = false;
timer = window.setTimeout(function() { setText("PASS"); passed = true; }, 1000);
input.ontouchend = input.ontouchmove = function() {
if (passed)
setText("Try again");