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:
parent
ead311eac7
commit
351567a01f
10 changed files with 85 additions and 0 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue