ladybird/Tests/LibWeb/Text/input/navigation/remove-iframe-from-timeout-callback.html
Aliaksandr Kalenik 609a72f7c7 LibWeb: Fix endless spinning in apply_the_history_step()
While waiting for a task that populates a session history entry, we
can't limit the processing of the event loop to the
`NavigationAndTraversal` task source. This is because fetching uses the
`Networking` task source, which also needs to be processed.

Since making a fetch request might take some time, we want to process
everything on the event loop while waiting, to avoid blocking user
interactions.

It is still possible to use `spin_processing_tasks_with_source_until()`
on subsequent steps of `apply_the_history_step()`.

Also modifies test that was flaky.
2024-03-30 07:35:55 +01:00

16 lines
475 B
HTML

<script src="../include.js"></script><div id="foo"><iframe></iframe><script>
setTimeout(function () {
foo.remove();
window.done = true;
}, 0);
</script></div><iframe></iframe><script>
asyncTest(function (done) {
let internalId;
internalId = setInterval(function () {
if (window.done) {
clearInterval(internalId);
done();
}
}, 0);
});
</script>PASS: did not crash