blob: 2d83bda940141ced543c608e22153afc601ac42b [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<meta name="viewport" content="width=device-width">
<script id="ui-script" type="text/plain">
(function() {
uiController.singleTapAtPoint(50, 50, function() {
uiController.uiScriptComplete();
});
})();
</script>
<script>
var uiScriptHasCompleted = false;
var boxClickCount = 0;
var firstClickEventTimeStamp = 0;
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function getUIScript()
{
return document.getElementById('ui-script').text;
}
function runTest()
{
if (testRunner.runUIScript) {
testRunner.runUIScript(getUIScript(), function() {
setTimeout(function() {
testRunner.runUIScript(getUIScript(), function() {
uiScriptHasCompleted = true;
if (boxClickCount == 2)
testRunner.notifyDone();
});
}, 100);
});
}
}
function boxClicked(event)
{
boxClickCount++;
if (boxClickCount == 1) {
document.getElementById('target').textContent = 'FAIL: only received one click event';
firstClickEventTimeStamp = event.timeStamp;
return;
}
if (boxClickCount == 2) {
if (event.timeStamp > firstClickEventTimeStamp)
document.getElementById('target').textContent = 'PASS: click events had increasing timeStamps';
else
document.getElementById('target').textContent = 'FAIL: click events did not have increasing timeStamps';
if (uiScriptHasCompleted && window.testRunner)
testRunner.notifyDone();
}
}
</script>
<style>
#target {
height: 100px;
width: 100px;
background-color: silver;
}
</style>
</head>
<body onload="runTest()">
<div id="target" onclick="boxClicked(event)">
FAIL: did not receive click event.
</div>
</body>
</html>