ladybird/Tests/LibWeb/Text/input/navigation/location-reload-fetch.html
Timothy Flynn 96082d6ae1 LibWeb: Port some manually async tests to use asyncTest
These tests were mostly async tests written in a manual way. This ports
them to use the standard asyncTest() infrastructure.

This is mostly just to reduce calls to internals.signalTextTestIsDone,
which will have a required parameter in an upcoming test.
2024-10-03 07:07:28 -04:00

30 lines
941 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(done => {
let reloaded = false;
window.addEventListener("message", event => {
switch (event.data.action) {
case "loaded":
println("iframe is loaded");
if (!reloaded) {
event.source.postMessage({ action: "reload" });
reloaded = true;
} else {
done();
}
break;
case "acknowledge-asked-to-reload":
println("iframe is going to reload");
break;
default:
break;
}
});
const iframe = document.createElement("iframe");
iframe.src = "../../data/iframe-reload.html";
document.body.appendChild(iframe);
});
</script>