commit 76cb8bb5228dffa1d24101f07f0ae484428592de
parent 3d15e1e8b5d67e3cadf3a4867bf16507b88138e3
Author: Julian Descottes <jdescottes@mozilla.com>
Date: Thu, 20 Nov 2025 14:51:42 +0000
Bug 1995762 - [devtools] Allow promise rejections in browser_destroying_iframes.js r=devtools-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D273192
Diffstat:
4 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/devtools/client/framework/moz.build b/devtools/client/framework/moz.build
@@ -7,6 +7,7 @@
BROWSER_CHROME_MANIFESTS += [
"test/browser-telemetry-startup.toml",
"test/browser.toml",
+ "test/browser_destroying_iframes.toml",
"test/metrics/browser_metrics.toml",
"test/metrics/browser_metrics_debugger.toml",
"test/metrics/browser_metrics_inspector.toml",
diff --git a/devtools/client/framework/test/browser.toml b/devtools/client/framework/test/browser.toml
@@ -65,12 +65,6 @@ skip-if = [
["browser_commands_from_url.js"]
-["browser_destroying_iframes.js"]
-skip-if = [
- "asan", # Getting random unhandled exceptions which aren't crashing DevTools
- "tsan",
-]
-
["browser_devtools_api_destroy.js"]
["browser_dynamic_tool_enabling.js"]
diff --git a/devtools/client/framework/test/browser_destroying_iframes.js b/devtools/client/framework/test/browser_destroying_iframes.js
@@ -2,11 +2,17 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
+// Frequent promise rejections which are not impacting the load of the toolbox.
+const { PromiseTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/PromiseTestUtils.sys.mjs"
+);
+PromiseTestUtils.allowMatchingRejectionsGlobally(/NS_ERROR_FAILURE/);
+
// Testing that there's no breaking exception when destroying
// an iframe early after its creation.
add_task(async function () {
- const { tab, toolbox } = await openInspectorForURL("about:blank");
+ const { tab } = await openInspectorForURL("about:blank");
const browser = tab.linkedBrowser;
// Create/remove an extra one now, after the load event.
@@ -18,7 +24,4 @@ add_task(async function () {
iframe.remove();
});
}
-
- // Wait for requests to settle to avoid unhandled promise rejections
- await toolbox.commands.waitForRequestsToSettle();
});
diff --git a/devtools/client/framework/test/browser_destroying_iframes.toml b/devtools/client/framework/test/browser_destroying_iframes.toml
@@ -0,0 +1,16 @@
+[DEFAULT]
+tags = "devtools"
+subsuite = "devtools"
+support-files = [
+ "head.js",
+ "!/devtools/client/shared/test/shared-head.js",
+ "!/devtools/client/shared/test/telemetry-test-helpers.js",
+]
+
+["browser_destroying_iframes.js"]
+skip-if = [
+ "asan", # Getting random unhandled exceptions which aren't crashing DevTools
+ "tsan",
+]
+# This test suite is dedicated to isolate browser_destroying_iframes.js which
+# needs to allow promise rejections, without impacting other tests.