blob: 6df32c7ddfc55f16c55eab5f00d94d0db405e5ba [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../utils.js"></script>
<script>
'use strict';
const fifteenDegrees = Math.PI / 12;
const thirtyDegrees = Math.PI / 6;
target_test((target, test) => {
target.addEventListener("pointerdown", event => {
assert_true(event instanceof PointerEvent);
assert_equals(event.type, "pointerdown");
assert_equals(event.clientX, 50);
assert_equals(event.clientY, 50);
assert_equals(event.pointerType, "pen");
assert_equals(event.pressure, 0.75);
assert_approx_equals(event.tiltX, 75, 1);
assert_approx_equals(event.tiltY, 20, 1);
test.done();
});
ui.tapStylus({ x: 50, y: 50, pressure: 0.75, azimuthAngle: fifteenDegrees, altitudeAngle: thirtyDegrees });
}, "Pointer events get dispatched in response to a stylus.");
</script>
</body>
</html>