mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 23:22:52 +00:00
We currently have a handful of iframe tests whose sources are in the "input" directory. This means they get run as their own tests, when they are really just helper files. We've had to add empty test expectation files for these "tests", and invoke a dummy test() method just to keep the test runner happy. Instead, move them to their own directory so the test runner does not see them at all.
28 lines
861 B
HTML
28 lines
861 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(async done => {
|
|
const iframe = document.getElementById("testIframe");
|
|
|
|
function navigateIframe(src) {
|
|
return new Promise(resolve => {
|
|
iframe.addEventListener("load", () => {
|
|
resolve();
|
|
});
|
|
iframe.src = src;
|
|
});
|
|
}
|
|
|
|
let receivedMessageCount = 0;
|
|
window.addEventListener("message", event => {
|
|
println(event.data);
|
|
receivedMessageCount++;
|
|
if (receivedMessageCount === 2) {
|
|
done();
|
|
}
|
|
});
|
|
|
|
await navigateIframe("../../data/iframe-test-content-1.html");
|
|
await navigateIframe("../../data/iframe-test-content-2.html");
|
|
});
|
|
</script>
|
|
<iframe id="testIframe" src="about:blank"></iframe>
|