summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /devtools/client/aboutdebugging/test
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/aboutdebugging/test')
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js2
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js2
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js2
-rw-r--r--devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js6
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-addons.js2
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-mocks.js25
-rw-r--r--devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js4
-rw-r--r--devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js2
-rw-r--r--devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js2
-rw-r--r--devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js2
10 files changed, 33 insertions, 16 deletions
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js
index a6f9fde0c1..da2596ef53 100644
--- a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js
@@ -45,7 +45,7 @@ add_task(async function testPreferenceRetrievedWhenInstallingExtension() {
await selectThisFirefoxPage(document, window.AboutDebugging.store);
const MockFilePicker = SpecialPowers.MockFilePicker;
- MockFilePicker.init(window);
+ MockFilePicker.init(window.browsingContext);
const onFilePickerShown = new Promise(resolve => {
MockFilePicker.showCallback = fp => {
resolve(fp);
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js
index 742791668d..4fd0b727d6 100644
--- a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js
@@ -85,7 +85,7 @@ add_task(async function () {
info("Wait for next interupt in the worker thread");
await clickElement(dbg, "pause");
- await waitForState(dbg, state => getIsWaitingOnBreak(getCurrentThread()));
+ await waitForState(dbg, () => getIsWaitingOnBreak(getCurrentThread()));
info("Trigger some code in the worker and wait for pause");
await SpecialPowers.spawn(swTab.linkedBrowser, [], async function () {
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js
index d4d31a7522..757f596891 100644
--- a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js
@@ -39,7 +39,7 @@ add_task(async function () {
usbRuntimeSidebarItem.querySelector(".qa-connect-button");
info("Simulate to happen connection error");
- mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async () => {
throw new Error("Dummy connection error");
};
diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js
index a5836ad50a..925ab62479 100644
--- a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js
+++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js
@@ -54,7 +54,7 @@ add_task(async function testSuccessfulConnectionAttempt() {
add_task(async function testFailedConnectionAttempt() {
const { doc, mocks, runtimeId, sessionId, tab } =
await setupConnectionAttemptTest();
- mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async () => {
throw new Error("failed");
};
@@ -168,8 +168,8 @@ add_task(async function testCancelledConnectionAttempt() {
await setupConnectionAttemptTest();
info("Simulate a connection timeout");
- mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
- await new Promise(r => {});
+ mocks.runtimeClientFactoryMock.createClientForRuntime = async () => {
+ await new Promise(() => {});
};
info("Click on the connect button and wait for the error message");
diff --git a/devtools/client/aboutdebugging/test/browser/helper-addons.js b/devtools/client/aboutdebugging/test/browser/helper-addons.js
index e3a8be3761..dd299a3c0f 100644
--- a/devtools/client/aboutdebugging/test/browser/helper-addons.js
+++ b/devtools/client/aboutdebugging/test/browser/helper-addons.js
@@ -180,7 +180,7 @@ function prepareMockFilePicker(pathOrFile) {
// Mock the file picker to select a test addon
const MockFilePicker = SpecialPowers.MockFilePicker;
- MockFilePicker.init(window);
+ MockFilePicker.init(window.browsingContext);
MockFilePicker.setFiles([file]);
}
/* exported prepareMockFilePicker */
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();
diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js
index f02ca02ee3..fce594684c 100644
--- a/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js
+++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js
@@ -39,7 +39,7 @@ function disableAdbMock() {
*/
function createAdbMock() {
const adbMock = {};
- adbMock.registerListener = function (listener) {
+ adbMock.registerListener = function () {
console.log("MOCKED METHOD registerListener");
};
@@ -55,7 +55,7 @@ function createAdbMock() {
console.log("MOCKED METHOD updateRuntimes");
};
- adbMock.unregisterListener = function (listener) {
+ adbMock.unregisterListener = function () {
console.log("MOCKED METHOD unregisterListener");
};
diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js
index b74c229fcf..29d7b0ad4d 100644
--- a/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js
+++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js
@@ -67,7 +67,7 @@ function disableRuntimeClientFactoryMock() {
*/
function createRuntimeClientFactoryMock() {
const RuntimeClientFactoryMock = {};
- RuntimeClientFactoryMock.createClientForRuntime = function (runtime) {
+ RuntimeClientFactoryMock.createClientForRuntime = function () {
console.log("MOCKED METHOD createClientForRuntime");
};
diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js
index de6ee1fb32..8e71e3b108 100644
--- a/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js
+++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js
@@ -1,6 +1,6 @@
"use strict";
// Bug 1328293
-self.onfetch = function (event) {
+self.onfetch = function () {
// do nothing.
};
diff --git a/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js b/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js
index 637e42e078..465e11a43b 100644
--- a/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js
+++ b/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js
@@ -194,7 +194,7 @@ add_task(async function test_without_traits_with_error() {
function createClientWrapper(preferencesFront) {
const clientWrapper = {
- getFront: name => {
+ getFront: () => {
return preferencesFront;
},
};