ladybird/Tests/LibWeb/Text/input/clipboard.html
Timothy Flynn 090dbac5a3 Revert "LibWeb: Allow bypassing transient activation checks for tests"
This reverts commit e52c30cbd5.

It's highly possible that this test was flaky on CI due to mixing units
of seconds and milliseconds in the transient activation calculation.
Revert the workaround for that commit in an attempt to avoid needless
ad-hoc behavior.
2024-02-25 12:35:49 -05:00

26 lines
733 B
HTML

<button id="button"></button>
<script src="include.js"></script>
<script type="text/javascript">
function writeText(onComplete) {
navigator.clipboard.writeText("Well hello friends :^)").then(
() => {
println("Success");
onComplete();
},
() => {
println("Failure");
onComplete();
}
);
}
asyncTest((done) => {
writeText(() => {
const button = document.getElementById("button");
internals.dispatchUserActivatedEvent(button, new Event("mousedown"));
button.dispatchEvent(new Event("click"));
writeText(done);
});
});
</script>