mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 15:13:07 +00:00
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.
30 lines
941 B
HTML
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>
|