diff options
Diffstat (limited to 'devtools/client/aboutdebugging/test/browser/helper-mocks.js')
-rw-r--r-- | devtools/client/aboutdebugging/test/browser/helper-mocks.js | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/devtools/client/aboutdebugging/test/browser/helper-mocks.js b/devtools/client/aboutdebugging/test/browser/helper-mocks.js index b1c9c910ff..a8536cf767 100644 --- a/devtools/client/aboutdebugging/test/browser/helper-mocks.js +++ b/devtools/client/aboutdebugging/test/browser/helper-mocks.js @@ -242,9 +242,28 @@ const silenceWorkerUpdates = function () { async function createLocalClientWrapper() { info("Create a local DevToolsClient"); + + // First, instantiate a DevToolsServer, the same way it is being done when running + // firefox --start-debugger-server const { - DevToolsServer, - } = require("resource://devtools/server/devtools-server.js"); + useDistinctSystemPrincipalLoader, + releaseDistinctSystemPrincipalLoader, + } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/DistinctSystemPrincipalLoader.sys.mjs" + ); + const requester = {}; + const serverLoader = useDistinctSystemPrincipalLoader(requester); + registerCleanupFunction(() => { + releaseDistinctSystemPrincipalLoader(requester); + }); + const { DevToolsServer } = serverLoader.require( + "resource://devtools/server/devtools-server.js" + ); + DevToolsServer.init(); + DevToolsServer.registerAllActors(); + DevToolsServer.allowChromeProcess = true; + + // Then spawn a DevToolsClient connected to this new DevToolsServer const { DevToolsClient, } = require("resource://devtools/client/devtools-client.js"); @@ -252,8 +271,6 @@ async function createLocalClientWrapper() { ClientWrapper, } = require("resource://devtools/client/aboutdebugging/src/modules/client-wrapper.js"); - DevToolsServer.init(); - DevToolsServer.registerAllActors(); const client = new DevToolsClient(DevToolsServer.connectPipe()); await client.connect(); |