diff options
Diffstat (limited to 'devtools/client/shared/test/shared-head.js')
-rw-r--r-- | devtools/client/shared/test/shared-head.js | 26 |
1 files changed, 25 insertions, 1 deletions
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" |