diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /dom/tests/browser/browser_bug1709346.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/browser/browser_bug1709346.js')
-rw-r--r-- | dom/tests/browser/browser_bug1709346.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/dom/tests/browser/browser_bug1709346.js b/dom/tests/browser/browser_bug1709346.js new file mode 100644 index 0000000000..c5ae529816 --- /dev/null +++ b/dom/tests/browser/browser_bug1709346.js @@ -0,0 +1,48 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +add_task(async function remove_subframe_in_cross_site_frame() { + await BrowserTestUtils.withNewTab( + "http://mochi.test:8888/browser/dom/tests/browser/file_empty_cross_site_frame.html", + async browser => { + await TestUtils.waitForCondition( + () => !XULBrowserWindow.isBusy, + "browser is not busy after the tab finishes loading" + ); + + // Spawn into the cross-site subframe, and begin loading a slow network + // connection. We'll cancel the load before this navigation completes. + await SpecialPowers.spawn( + browser.browsingContext.children[0], + [], + async () => { + let frame = content.document.createElement("iframe"); + frame.src = "load_forever.sjs"; + content.document.body.appendChild(frame); + + frame.addEventListener("load", function() { + ok(false, "load should not finish before the frame is removed"); + }); + } + ); + + is( + XULBrowserWindow.isBusy, + true, + "browser should be busy after the load starts" + ); + + // Remove the outer iframe, ending the load within this frame's subframe + // early. + await SpecialPowers.spawn(browser, [], async () => { + content.document.querySelector("iframe").remove(); + }); + + await TestUtils.waitForCondition( + () => !XULBrowserWindow.isBusy, + "Browser should no longer be busy after the frame is removed" + ); + } + ); +}); |