<!DOCTYPE html>
<html>
<head>
<script src="../../../../../resources/js-test-pre.js"></script>
<script src="resources/helpers.js"></script>
<style>* { margin: 0; padding: 0; }</style>
</head>
<body>
<div id="box" style="background:blue;width:100px;height:100px;position:absolute;top:100px;left:100px"></div>
<p id="description"></p>
<div id="console"></div>
<!-- Filler to allow scrolling -->
<div style="width:1500px;height:1500px;"></div>
<script>
description("This tests touch event coordinates unscaled.");

var box = document.getElementById('box');
box.ontouchstart = function(event) { debug('touchstart'); verifyCoordinates(event.touches[0]); }
box.ontouchmove = function(event) { debug('touchmove'); verifyCoordinates(event.touches[0]); }
box.ontouchend = function(event) { debug('touchend - no touch to check'); endTest(); }

const FIRST_FINGER = 0;
function sendTouchSequence() {
    if (!window.eventSender) {
        debug("This test requires DumpRenderTree to send touch events.");
        return;
    }

    setExpectedValues(125, 175, 125, 175);
    eventSender.addTouchPoint(125, 175);
    eventSender.touchStart();

    setExpectedValues(175, 125, 175, 125);
    eventSender.updateTouchPoint(FIRST_FINGER, 175, 125);
    eventSender.touchMove();

    eventSender.releaseTouchPoint(FIRST_FINGER);
    eventSender.touchEnd(); // The test will end with this release.
}

sendTouchSequence();

var successfullyParsed = true;
</script>
</body>
</html>
