blob: 1838fb7921516a1cf1c62990cd90c4dfcd29e4c0 [file] [edit]
<html>
<body>
<input type="text" id="text" value="some sample text">
</body>
</html>
<script>
// This test checks that if the user right clicks on selected text,
// the selected text doesn't change or get deselected.
var input = document.getElementById("text");
input.focus();
input.selectionStart = 5;
input.selectionEnd = 15;
onload = async () => {
if (window.testRunner) {
testRunner.waitUntilDone();
var x, y;
x = input.offsetParent.offsetLeft + input.offsetLeft + input.offsetWidth / 2;
y = input.offsetParent.offsetTop + input.offsetTop + input.offsetHeight / 2;
await eventSender.asyncMouseMoveTo(x, y);
eventSender.contextClick();
testRunner.notifyDone();
}
}
</script>