1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:57:44 +00:00

Tests/LibWeb: Add text tests for navigation

This commit is contained in:
Aliaksandr Kalenik 2023-09-15 01:25:23 +02:00 committed by Andreas Kling
parent ead311eac7
commit 351567a01f
10 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<script src="../include.js"></script>
<script>
asyncTest(async done => {
const iframe = document.getElementById("testIframe");
function navigateIframe(srcdoc) {
return new Promise(resolve => {
iframe.addEventListener("load", () => {
resolve();
});
iframe.srcdoc = srcdoc;
});
}
await navigateIframe("<h1>Well</h1>");
println(iframe.contentWindow.document.body.innerText);
await navigateIframe("<h2>Hello friends!</h2>");
println(iframe.contentWindow.document.body.innerText);
done();
});
</script>
<iframe id="testIframe" src="about:blank"></iframe>