blob: 1761d288df8686bcbcdf7529520d2710ef331418 [file] [log] [blame]
<!--
Copyright 2023 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!doctype html>
<html>
<head>
<title>Test interactions website</title>
</head>
<body>
<button id="long-click">Long click</button>
<input type="text" id="long-type" />
<script>
function wait(ms) {
const start = Date.now();
let now = Date.now();
while (now - start < ms) {
now = Date.now();
}
}
let firstClick = true;
const button = document.getElementById('long-click');
button.onpointerdown = () => {
wait(100);
}
button.onpointerup = () => {
wait(100);
}
button.onclick = () => {
if (firstClick) {
wait(300);
firstClick = false;
} else {
wait(100);
}
}
const input = document.getElementById('long-type');
input.onkeydown = () => {
wait(100);
}
input.onkeyup = () => {
wait(100);
}
input.onkeypress = () => {
wait(100);
}
</script>
</body>
</html>