Files
ladybird/Tests/LibWeb/Text/input/UIEvents/gc-mouse-selection-target.html
Jelle Raaijmakers f55fe69d4d LibWeb: Rework Internals' mouse control
Instead of defining somewhat high level mouse actions, allow granular
control of mouse clicks and mouse down/up/move events. We will want to
simulate things like holding down a mouse button after double clicking
and then dragging the mouse to another position in the future, and this
enables that.
2026-02-06 14:18:10 +00:00

38 lines
1002 B
HTML

<!DOCTYPE html>
<iframe id="iframe"></iframe>
<script src="../include.js"></script>
<script>
const runTest = () => {
return new Promise(resolve => {
let iframe = document.getElementById("iframe");
iframe.onload = () => {
internals.mouseMove(20, 40);
internals.mouseDown(20, 40);
internals.mouseMove(60, 40);
iframe.onload = () => {
setTimeout(() => {
internals.mouseMove(20, 40);
resolve();
});
};
iframe.src = "data:text/html,<p contenteditable>Text 2</p>";
};
iframe.src = "data:text/html,<p contenteditable>Text 1</p>";
});
};
asyncTest(async done => {
for (let i = 0; i < 10; ++i) {
await runTest();
internals.gc();
}
println("PASS (didn't crash)");
done();
});
</script>