diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /devtools/client/shared/test | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/shared/test')
4 files changed, 59 insertions, 6 deletions
diff --git a/devtools/client/shared/test/browser_browserloader_mocks.js b/devtools/client/shared/test/browser_browserloader_mocks.js index 6cc38259f3..5a67b6fcd2 100644 --- a/devtools/client/shared/test/browser_browserloader_mocks.js +++ b/devtools/client/shared/test/browser_browserloader_mocks.js @@ -3,8 +3,8 @@ "use strict"; -const { BrowserLoader } = ChromeUtils.import( - "resource://devtools/shared/loader/browser-loader.js" +const { BrowserLoader } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/browser-loader.sys.mjs" ); const { diff --git a/devtools/client/shared/test/browser_outputparser.js b/devtools/client/shared/test/browser_outputparser.js index 226e0bb685..7e0c1b7e00 100644 --- a/devtools/client/shared/test/browser_outputparser.js +++ b/devtools/client/shared/test/browser_outputparser.js @@ -6,7 +6,6 @@ add_task(async function () { await pushPref("layout.css.backdrop-filter.enabled", true); await pushPref("layout.css.individual-transform.enabled", true); - await pushPref("layout.css.motion-path-basic-shapes.enabled", true); await addTab("about:blank"); await performTest(); gBrowser.removeCurrentTab(); @@ -671,6 +670,36 @@ function testParseVariable(doc, parser) { `</span>)` + `</span>`, }, + { + text: "rgba(var(--r), 0, 0, var(--a))", + variables: { "--r": "255", "--a": "0.5" }, + expected: + // prettier-ignore + '<span data-color="rgba(255, 0, 0, 0.5)">' + + "<span>rgba("+ + "<span>" + + 'var(<span data-variable="--r = 255">--r</span>)' + + "</span>, 0, 0, " + + "<span>" + + 'var(<span data-variable="--a = 0.5">--a</span>)' + + "</span>" + + ")</span>" + + "</span>", + }, + { + text: "rgb(var(--not-seen, 255), 0, 0)", + variables: {}, + expected: + // prettier-ignore + '<span data-color="rgb( 255, 0, 0)">' + + "<span>rgb("+ + "<span>var(" + + `<span class="unmatched-class" data-variable="--not-seen is not set">--not-seen</span>,` + + `<span> 255</span>` + + ")</span>, 0, 0" + + ")</span>" + + "</span>", + }, ]; for (const test of TESTS) { diff --git a/devtools/client/shared/test/browser_require_raw.js b/devtools/client/shared/test/browser_require_raw.js index bcf4afe98f..64d48f2eb1 100644 --- a/devtools/client/shared/test/browser_require_raw.js +++ b/devtools/client/shared/test/browser_require_raw.js @@ -3,8 +3,8 @@ "use strict"; -const { BrowserLoader } = ChromeUtils.import( - "resource://devtools/shared/loader/browser-loader.js" +const { BrowserLoader } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/browser-loader.sys.mjs" ); const { require: browserRequire } = BrowserLoader({ diff --git a/devtools/client/shared/test/shared-head.js b/devtools/client/shared/test/shared-head.js index aa47b35edd..0657ede75e 100644 --- a/devtools/client/shared/test/shared-head.js +++ b/devtools/client/shared/test/shared-head.js @@ -93,6 +93,30 @@ if (DEBUG_STEP) { }); } +const DEBUG_TRACE_LINE = Services.env.get("DEBUG_TRACE_LINE"); +if (DEBUG_TRACE_LINE) { + // Use a custom loader with `invisibleToDebugger` flag for the allocation tracker + // as it instantiates custom Debugger API instances and has to be running in a distinct + // compartments from DevTools and system scopes (ESMs, XPCOM,...) + const { + useDistinctSystemPrincipalLoader, + releaseDistinctSystemPrincipalLoader, + } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/DistinctSystemPrincipalLoader.sys.mjs" + ); + const requester = {}; + const loader = useDistinctSystemPrincipalLoader(requester); + + const lineTracer = loader.require( + "resource://devtools/shared/test-helpers/test-line-tracer.js" + ); + lineTracer.start(globalThis, gTestPath, DEBUG_TRACE_LINE); + registerCleanupFunction(() => { + lineTracer.stop(); + releaseDistinctSystemPrincipalLoader(requester); + }); +} + const { loader, require } = ChromeUtils.importESModule( "resource://devtools/shared/loader/Loader.sys.mjs" ); @@ -276,7 +300,7 @@ registerCleanupFunction(() => { Services.prefs.clearUserPref("dom.ipc.processPrelaunch.enabled"); Services.prefs.clearUserPref("devtools.toolbox.host"); Services.prefs.clearUserPref("devtools.toolbox.previousHost"); - Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled"); + Services.prefs.clearUserPref("devtools.toolbox.splitconsole.open"); Services.prefs.clearUserPref("devtools.toolbox.splitconsoleHeight"); Services.prefs.clearUserPref( "javascript.options.asyncstack_capture_debuggee_only" |