diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /devtools/client/framework/test | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/framework/test')
15 files changed, 47 insertions, 20 deletions
diff --git a/devtools/client/framework/test/browser_devtools_api_destroy.js b/devtools/client/framework/test/browser_devtools_api_destroy.js index 736455df65..56cf001f76 100644 --- a/devtools/client/framework/test/browser_devtools_api_destroy.js +++ b/devtools/client/framework/test/browser_devtools_api_destroy.js @@ -38,11 +38,11 @@ async function runTests(aTab) { const panel = toolbox.getPanel(toolDefinition.id); ok(panel, "Tool open"); - gDevTools.once("toolbox-destroy", (toolbox, iframe) => { + gDevTools.once("toolbox-destroy", () => { collectedEvents.push("toolbox-destroy"); }); - gDevTools.once(toolDefinition.id + "-destroy", (toolbox, iframe) => { + gDevTools.once(toolDefinition.id + "-destroy", () => { collectedEvents.push("gDevTools-" + toolDefinition.id + "-destroy"); }); diff --git a/devtools/client/framework/test/browser_keybindings_01.js b/devtools/client/framework/test/browser_keybindings_01.js index 968c3a3d3d..3f48a5dfa2 100644 --- a/devtools/client/framework/test/browser_keybindings_01.js +++ b/devtools/client/framework/test/browser_keybindings_01.js @@ -97,6 +97,33 @@ add_task(async function () { key.synthesizeKey(); await onPickerStop; ok(true, "picker-stopped event received, highlighter stopped"); + + info( + `Run the keyboard shortcut for ${test.id} with picker shortcut disabled` + ); + await pushPref("devtools.command-button-pick.enabled", false); + + // Switch to another panel to assure the hotkey still opens inspector + await toolbox.selectTool("webconsole"); + await waitUntil(() => toolbox.currentToolId === "webconsole"); + + // Check if picker event times out + const onHasPickerStarted = Promise.race([ + toolbox.nodePicker.once("picker-started").then(() => true), + wait(100).then(() => false), + ]); + + key.synthesizeKey(); + const hasPickerStarted = await onHasPickerStarted; + + ok(!hasPickerStarted, "picker was not started on shortcut"); + is( + toolbox.currentToolId, + "inspector", + "shortcut still switches tab to inspector" + ); + + await pushPref("devtools.command-button-pick.enabled", true); } await onSelectTool; diff --git a/devtools/client/framework/test/browser_target_parents.js b/devtools/client/framework/test/browser_target_parents.js index 795219abef..d66339739c 100644 --- a/devtools/client/framework/test/browser_target_parents.js +++ b/devtools/client/framework/test/browser_target_parents.js @@ -60,7 +60,7 @@ add_task(async function () { // With that, we were chasing a precise race, where a second call to ProcessDescriptor.getTarget() // happens between the instantiation of ContentProcessTarget and its call to attach() from getTarget // function. - await testGetTargetWithConcurrentCalls(processes, processTarget => { + await testGetTargetWithConcurrentCalls(processes, () => { // We only call ContentProcessTargetFront.attach and not TargetMixin.attachAndInitThread. // So nothing is done for content process targets. return true; diff --git a/devtools/client/framework/test/browser_target_server_compartment.js b/devtools/client/framework/test/browser_target_server_compartment.js index c0bd8e56f0..652f9e0bfb 100644 --- a/devtools/client/framework/test/browser_target_server_compartment.js +++ b/devtools/client/framework/test/browser_target_server_compartment.js @@ -26,7 +26,7 @@ async function testChromeTab() { ); const onThreadActorInstantiated = new Promise(resolve => { - const observe = function (subject, topic, data) { + const observe = function (subject, topic) { if (topic === "devtools-thread-ready") { Services.obs.removeObserver(observe, "devtools-thread-ready"); const threadActor = subject.wrappedJSObject; @@ -62,7 +62,7 @@ async function testChromeTab() { ); const onDedicatedLoaderDestroy = new Promise(resolve => { - const observe = function (subject, topic, data) { + const observe = function (subject, topic) { if (topic === "devtools:loader:destroy") { Services.obs.removeObserver(observe, "devtools:loader:destroy"); resolve(); @@ -81,7 +81,7 @@ async function testChromeTab() { // Test that Main process Target can debug chrome scripts async function testMainProcess() { const onThreadActorInstantiated = new Promise(resolve => { - const observe = function (subject, topic, data) { + const observe = function (subject, topic) { if (topic === "devtools-thread-ready") { Services.obs.removeObserver(observe, "devtools-thread-ready"); const threadActor = subject.wrappedJSObject; diff --git a/devtools/client/framework/test/browser_toolbox_highlight.js b/devtools/client/framework/test/browser_toolbox_highlight.js index d0712aeed5..401f5df9f6 100644 --- a/devtools/client/framework/test/browser_toolbox_highlight.js +++ b/devtools/client/framework/test/browser_toolbox_highlight.js @@ -62,7 +62,7 @@ function test() { finish(); }); }); - })().catch(error => { + })().catch(() => { ok(false, "There was an error running the test."); }); } diff --git a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html index 4065aabc2b..06b6281588 100644 --- a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html +++ b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html @@ -15,9 +15,9 @@ // enabled, so dereferencing it would throw a ReferenceError (which // is then caught in the .catch() clause). return window.navigator.serviceWorker.register("serviceworker.js"); - }).then(registration => { + }).then(() => { return {success: true}; - }).catch(error => { + }).catch(() => { return {success: false}; }); } @@ -36,7 +36,7 @@ function iframeRegisterAndUnregister() { var frame = window.document.createElement("iframe"); - var promise = new Promise(function(resolve, reject) { + var promise = new Promise(function(resolve) { frame.addEventListener("load", function() { Promise.resolve().then(_ => { return frame.contentWindow.navigator.serviceWorker.register("serviceworker.js"); @@ -45,7 +45,7 @@ }).then(_ => { frame.remove(); resolve({success: true}); - }).catch(error => { + }).catch(() => { resolve({success: false}); }); }, {once: true}); diff --git a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js index 152f64f835..315b1f1e55 100644 --- a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js +++ b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js @@ -67,7 +67,7 @@ function register() { return sendMessage("devtools:sw-test:register"); } -function unregister(swr) { +function unregister() { return sendMessage("devtools:sw-test:unregister"); } diff --git a/devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js b/devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js index 74c0983d4e..d8d4d3057d 100644 --- a/devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js +++ b/devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js @@ -66,7 +66,7 @@ async function testToggleTools() { await toggleTool(tab2, toolId); } -async function toggleTool({ doc, panelWin, checkbox, tab }, toolId) { +async function toggleTool({ panelWin, checkbox }, toolId) { const prevChecked = checkbox.checked; (prevChecked ? checkRegistered : checkUnregistered)(toolId); diff --git a/devtools/client/framework/test/browser_toolbox_select_event.js b/devtools/client/framework/test/browser_toolbox_select_event.js index ebdae9af13..bbfd36eae4 100644 --- a/devtools/client/framework/test/browser_toolbox_select_event.js +++ b/devtools/client/framework/test/browser_toolbox_select_event.js @@ -72,7 +72,7 @@ add_task(async function () { async function testSelectToolRace() { const toolbox = await openToolboxForTab(tab, "webconsole"); let selected = false; - const onSelect = (event, id) => { + const onSelect = () => { if (selected) { ok(false, "Got more than one 'select' event"); } else { diff --git a/devtools/client/framework/test/browser_toolbox_telemetry_activate_splitconsole.js b/devtools/client/framework/test/browser_toolbox_telemetry_activate_splitconsole.js index cd1a478f5c..31c52e432e 100644 --- a/devtools/client/framework/test/browser_toolbox_telemetry_activate_splitconsole.js +++ b/devtools/client/framework/test/browser_toolbox_telemetry_activate_splitconsole.js @@ -103,6 +103,6 @@ async function checkResults() { // extras is(extra.host, expected.extra.host, "host is correct"); - ok(extra.width > 0, "width is greater than 0"); + Assert.greater(Number(extra.width), 0, "width is greater than 0"); } } diff --git a/devtools/client/framework/test/browser_toolbox_telemetry_enter.js b/devtools/client/framework/test/browser_toolbox_telemetry_enter.js index 4cb4611a97..ac1253ec79 100644 --- a/devtools/client/framework/test/browser_toolbox_telemetry_enter.js +++ b/devtools/client/framework/test/browser_toolbox_telemetry_enter.js @@ -144,7 +144,7 @@ async function checkResults() { // extras is(extra.host, expected.extra.host, "host is correct"); - ok(extra.width > 0, "width is greater than 0"); + Assert.greater(Number(extra.width), 0, "width is greater than 0"); is(extra.start_state, expected.extra.start_state, "start_state is correct"); is(extra.panel_name, expected.extra.panel_name, "panel_name is correct"); is(extra.cold, expected.extra.cold, "cold is correct"); diff --git a/devtools/client/framework/test/browser_toolbox_telemetry_exit.js b/devtools/client/framework/test/browser_toolbox_telemetry_exit.js index 3056b9af8c..98f831d6d4 100644 --- a/devtools/client/framework/test/browser_toolbox_telemetry_exit.js +++ b/devtools/client/framework/test/browser_toolbox_telemetry_exit.js @@ -121,7 +121,7 @@ async function checkResults() { // extras is(extra.host, expected.extra.host, "host is correct"); - ok(extra.width > 0, "width is greater than 0"); + Assert.greater(Number(extra.width), 0, "width is greater than 0"); is(extra.panel_name, expected.extra.panel_name, "panel_name is correct"); is(extra.next_panel, expected.extra.next_panel, "next_panel is correct"); is(extra.reason, expected.extra.reason, "reason is correct"); diff --git a/devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js b/devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js index cdd6678e6f..d5780c083c 100644 --- a/devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js +++ b/devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js @@ -10,7 +10,7 @@ const SIDEBAR_WIDTH_PREF = "devtools.toolbox.sidebar.width"; const { Toolbox } = require("resource://devtools/client/framework/toolbox.js"); -add_task(async function (pickerEnable, commandsEnable) { +add_task(async function () { // 74px is Chevron(26px) + Meatball(24px) + Close(24px) // devtools-browser.css defined this minimum width by using min-width. Services.prefs.setIntPref(SIDEBAR_WIDTH_PREF, 74); diff --git a/devtools/client/framework/test/browser_toolbox_window_reload_target.js b/devtools/client/framework/test/browser_toolbox_window_reload_target.js index d9a4eb34c1..8415af88f2 100644 --- a/devtools/client/framework/test/browser_toolbox_window_reload_target.js +++ b/devtools/client/framework/test/browser_toolbox_window_reload_target.js @@ -46,7 +46,7 @@ add_task(async function () { "Listen to page reloads to check that they are indeed sent by the toolbox" ); let reloadDetected = 0; - const reloadCounter = msg => { + const reloadCounter = () => { reloadDetected++; info("Detected reload #" + reloadDetected); is( diff --git a/devtools/client/framework/test/helper_disable_cache.js b/devtools/client/framework/test/helper_disable_cache.js index a98a68cc9f..31db6d81b4 100644 --- a/devtools/client/framework/test/helper_disable_cache.js +++ b/devtools/client/framework/test/helper_disable_cache.js @@ -93,7 +93,7 @@ async function setDisableCacheCheckboxChecked(tabX, state) { if (cbx.checked !== state) { info("Setting disable cache checkbox to " + state + " for " + tabX.title); - const onReconfigured = tabX.toolbox.once("cache-reconfigured"); + const onReconfigured = tabX.toolbox.once("new-configuration-applied"); cbx.click(); // We have to wait for the reconfigure request to be finished before reloading |