1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 05:54:58 +00:00
serenity/Tests/LibWeb/Text/input/clipboard.html
Timothy Flynn e52c30cbd5 LibWeb: Allow bypassing transient activation checks for tests
We have a 5 second timeout between a user-activated event occurring and
an activation-gated API being invoked in order for that API to succeed.
This is quite fine in normal circumstances, but the machines used in CI
often exceed that limit (we see upwards of 10 seconds passing between
generating the user-activated event and the API call running).

So instead of generating a user-activated event, add a hook to allow
tests to bypass the very next activation check.
2024-02-20 18:53:59 -05:00

23 lines
598 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(() => {
internals.bypassNextTransientActivationTest = true;
writeText(done);
});
});
</script>