mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 10:36:24 +00:00
LibWeb: Resolve postMessage test promises if iframes already loaded
For some reason on macOS with ASAN enabled, the test promises in HTML/Window-postMessage do not resolve. These promises wait for both the in-document and the blob url iframes to load. It's not clear why this works fine in Linux nor why the onload handler doesn't fire when the iframe has already loaded.
This commit is contained in:
parent
e025bcc4f9
commit
08a3c562f3
|
@ -1,4 +1,3 @@
|
|||
[Skipped]
|
||||
Text/input/HTML/Window-postMessage.html
|
||||
Text/input/Worker/Worker-echo.html
|
||||
Text/input/window-scrollTo.html
|
||||
|
|
|
@ -127,11 +127,21 @@
|
|||
globalThis.doneCallback = done;
|
||||
|
||||
const blobIframeLoadPromise = new Promise(resolve => {
|
||||
blobIframe.onload = () => resolve();
|
||||
if (blobIframe.contentDocument.readyState === "complete") {
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
blobIframe.onload = () => resolve();
|
||||
}
|
||||
});
|
||||
|
||||
const srcdocIframeLoadPromise = new Promise(resolve => {
|
||||
iframe.onload = () => resolve();
|
||||
if (iframe.contentDocument.readyState === "complete") {
|
||||
resolve()
|
||||
}
|
||||
else {
|
||||
iframe.onload = () => resolve();
|
||||
}
|
||||
});
|
||||
|
||||
Promise.all([blobIframeLoadPromise, srcdocIframeLoadPromise]).then(() => {
|
||||
|
|
Loading…
Reference in a new issue