diff --git a/src/devtools/client/debugger/src/client/firefox-js.patch b/src/devtools/client/debugger/src/client/firefox-js.patch new file mode 100644 index 00000000000..0c8164a0850 --- /dev/null +++ b/src/devtools/client/debugger/src/client/firefox-js.patch @@ -0,0 +1,23 @@ +diff --git a/devtools/client/debugger/src/client/firefox.js b/devtools/client/debugger/src/client/firefox.js +index 9a269e6e87a631cad95f89b9cd679a5cf5552879..0d1c56d12875c2307c9003aebf084d2803e8fcdd 100644 +--- a/devtools/client/debugger/src/client/firefox.js ++++ b/devtools/client/debugger/src/client/firefox.js +@@ -11,9 +11,6 @@ import sourceQueue from "../utils/source-queue"; + const { + TRACER_LOG_METHODS, + } = require("resource://devtools/shared/specs/tracer.js"); +-const { AppConstants } = ChromeUtils.importESModule( +- "resource://gre/modules/AppConstants.sys.mjs" +-); + const { PrefObserver } = require("resource://devtools/client/shared/prefs.js"); + const DEVTOOLS_STYLESHEETS_IN_DEBUGGER = + "devtools.debugger.features.stylesheets-in-debugger"; +@@ -116,7 +113,7 @@ export async function onConnect(_commands, _resourceCommand, _actions, store) { + commands.tracerCommand.on("toggle", onTracingToggled); + + if (!commands.client.isLocalClient) { +- const localPlatformVersion = AppConstants.MOZ_APP_VERSION; ++ const localPlatformVersion = Services.appinfo.platformVersion; + const remotePlatformVersion = await getRemotePlatformVersion(); + actions.setLocalAndRemoteRuntimeVersion( + localPlatformVersion, diff --git a/src/devtools/client/shared/remote-debugging/version-checker-js.patch b/src/devtools/client/shared/remote-debugging/version-checker-js.patch new file mode 100644 index 00000000000..c12a6a0ac1e --- /dev/null +++ b/src/devtools/client/shared/remote-debugging/version-checker-js.patch @@ -0,0 +1,24 @@ +diff --git a/devtools/client/shared/remote-debugging/version-checker.js b/devtools/client/shared/remote-debugging/version-checker.js +index 8437408641a8db985d343b33314feffbec75888b..efa12f43ab5ae32eac3583c6315341c85f016ec2 100644 +--- a/devtools/client/shared/remote-debugging/version-checker.js ++++ b/devtools/client/shared/remote-debugging/version-checker.js +@@ -4,10 +4,6 @@ + + "use strict"; + +-const { AppConstants } = ChromeUtils.importESModule( +- "resource://gre/modules/AppConstants.sys.mjs" +-); +- + const MS_PER_DAY = 1000 * 60 * 60 * 24; + + const COMPATIBILITY_STATUS = { +@@ -83,7 +79,7 @@ function computeMinMaxVersion(localVersion) { + async function checkVersionCompatibility(devToolsClient) { + const localDescription = { + appbuildid: Services.appinfo.appBuildID, +- platformversion: AppConstants.MOZ_APP_VERSION, ++ platformversion: Services.appinfo.platformVersion, + }; + + try { diff --git a/src/zen/tests/devtools/browser.toml b/src/zen/tests/devtools/browser.toml new file mode 100644 index 00000000000..66cca8f021c --- /dev/null +++ b/src/zen/tests/devtools/browser.toml @@ -0,0 +1,7 @@ +# 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/. + +[DEFAULT] + +["browser_remote_debugging_version_check.js"] diff --git a/src/zen/tests/devtools/browser_remote_debugging_version_check.js b/src/zen/tests/devtools/browser_remote_debugging_version_check.js new file mode 100644 index 00000000000..802ee207f6a --- /dev/null +++ b/src/zen/tests/devtools/browser_remote_debugging_version_check.js @@ -0,0 +1,44 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { require } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/Loader.sys.mjs" +); +const { + DevToolsClient, +} = require("resource://devtools/client/devtools-client.js"); +const { + DevToolsServer, +} = require("resource://devtools/server/devtools-server.js"); +const { + checkVersionCompatibility, + COMPATIBILITY_STATUS, +} = require("resource://devtools/client/shared/remote-debugging/version-checker.js"); + +add_task(async function test_this_zen_runtime_is_compatible() { + DevToolsServer.init(); + DevToolsServer.registerAllActors(); + DevToolsServer.allowChromeProcess = true; + + const client = new DevToolsClient(DevToolsServer.connectPipe()); + await client.connect(); + registerCleanupFunction(async () => { + await client.close(); + DevToolsServer.destroy(); + DevToolsServer.allowChromeProcess = false; + }); + + const report = await checkVersionCompatibility(client); + is( + report.localVersion, + Services.appinfo.platformVersion, + "Local version is the platform version" + ); + is( + report.status, + COMPATIBILITY_STATUS.COMPATIBLE, + "This Zen is reported as compatible with itself" + ); +}); diff --git a/src/zen/tests/moz.build b/src/zen/tests/moz.build index 6c90eba8b42..0ba5c372766 100644 --- a/src/zen/tests/moz.build +++ b/src/zen/tests/moz.build @@ -8,6 +8,7 @@ BROWSER_CHROME_MANIFESTS += [ "compact_mode/browser.toml", "container_essentials/browser.toml", "device_sync/browser.toml", + "devtools/browser.toml", "folders/browser.toml", "glance/browser.toml", "kbs/browser.toml",