mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +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
Notes:
sideshowbarker
2024-07-16 22:22:13 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/08a3c562f3 Pull-request: https://github.com/SerenityOS/serenity/pull/22940 Reviewed-by: https://github.com/trflynn89
2 changed files with 12 additions and 3 deletions
|
@ -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