blob: b06e57bc871bd485c0e1f9a49f7121ceb085c255 [file] [log] [blame] [edit]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
async function clickLink() {
var link = document.getElementById("anchorLink");
await eventSender.asyncMouseMoveTo(link.offsetLeft + 2, link.offsetTop + 2);
await eventSender.asyncMouseDown();
await eventSender.asyncMouseUp();
}
async function run() {
await clickLink();
window.scroll(0, 0);
await clickLink();
var scrollY = window.scrollY;
var line = document.createElement('div');
line.appendChild(document.createTextNode("Scroll position is " + scrollY + "px"));
document.getElementById('anchor').appendChild(line);
testRunner.notifyDone();
}
</script>
</head>
<body onload="run();">
<div style="height: 600px">
<a id="anchorLink" href="#anchor">Anchor link</a>
</div>
<div id="anchor" style="height: 600px"></div>
</body>
</html>