Truly independent web browser
Tests/LibWeb: Load iframes in parallel in a slow site isolation test
Tim Ledbetter92023225bf6e
diff --git a/Tests/LibWeb/Text/input/SiteIsolation/iframe/remote-iframe-removed-while-coming-back-to-this-process.html b/Tests/LibWeb/Text/input/SiteIsolation/iframe/remote-iframe-removed-while-coming-back-to-this-process.htmlindex 6cb461304cb..74776eed286 100644--- a/Tests/LibWeb/Text/input/SiteIsolation/iframe/remote-iframe-removed-while-coming-back-to-this-process.html+++ b/Tests/LibWeb/Text/input/SiteIsolation/iframe/remote-iframe-removed-while-coming-back-to-this-process.html@@ -6,7 +6,7 @@// activates.promiseTest(async () => {const httpServer = httpTestServer();- const FRAME_COUNT = 30;+ const FRAME_COUNT = 15;const localUrl = await httpServer.createEcho("GET", "/remote-iframe-removed-while-coming-back-local", {status: 200,@@ -22,18 +22,20 @@);remoteUrl.hostname = uniqueLocalhostHostname("remote-iframe-removed-while-coming-back");+ const loaded = frame => new Promise(resolve => (frame.onload = resolve));const frames = [];for (let i = 0; i < FRAME_COUNT; ++i) {const frame = document.createElement("iframe");frame.src = localUrl;frames.push(frame);- document.body.appendChild(frame);- await new Promise(resolve => (frame.onload = resolve));}- for (const frame of frames) {+ const framesLoaded = Promise.all(frames.map(loaded));+ document.body.append(...frames);+ await framesLoaded;+ const framesNavigated = Promise.all(frames.map(loaded));+ for (const frame of frames)frame.contentWindow.location.href = remoteUrl.href;- await new Promise(resolve => (frame.onload = resolve));- }+ await framesNavigated;if (remoteFrameCount() !== FRAME_COUNT) {println("iframes did not become remote");return;