From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../test/browser_autocomplete_popup_input.js | 5 ++- .../client/shared/test/browser_cubic-bezier-02.js | 2 +- .../client/shared/test/browser_cubic-bezier-06.js | 2 +- .../client/shared/test/browser_dbg_listworkers.js | 4 +-- .../shared/test/browser_inplace-editor-01.js | 6 ++-- .../client/shared/test/browser_key_shortcuts.js | 2 +- devtools/client/shared/test/browser_spectrum.js | 7 +--- .../shared/test/browser_tableWidget_basic.js | 3 ++ .../test/browser_telemetry_button_eyedropper.js | 2 +- .../client/shared/test/browser_treeWidget_basic.js | 6 ++-- .../client/shared/test/doc_event-listeners-01.html | 8 ++--- .../client/shared/test/doc_event-listeners-03.html | 4 +-- .../doc_layoutHelpers_getBoxQuads2-c-and-e.html | 2 +- .../shared/test/doc_native-event-handler.html | 2 +- .../client/shared/test/highlighter-test-actor.js | 2 +- devtools/client/shared/test/shared-head.js | 39 ++++++++++++++++++++++ 16 files changed, 68 insertions(+), 28 deletions(-) (limited to 'devtools/client/shared/test') diff --git a/devtools/client/shared/test/browser_autocomplete_popup_input.js b/devtools/client/shared/test/browser_autocomplete_popup_input.js index a7d04f1c9c..32fc6da25e 100644 --- a/devtools/client/shared/test/browser_autocomplete_popup_input.js +++ b/devtools/client/shared/test/browser_autocomplete_popup_input.js @@ -19,7 +19,8 @@ add_task(async function () { const { doc } = await createHost(); const input = doc.createElement("input"); - doc.body.append(input, doc.createElement("input")); + const prevInput = doc.createElement("input"); + doc.body.append(prevInput, input, doc.createElement("input")); const onSelectCalled = []; const onClickCalled = []; @@ -189,7 +190,9 @@ add_task(async function () { ); EventUtils.synthesizeKey("KEY_Tab", { shiftKey: true }); is(onClickCalled.length, 3, "onClick wasn't called"); + is(hasFocus(input), false, "input does not have the focus anymore"); + is(hasFocus(prevInput), true, "Shift+Tab moves the focus to prevInput"); const onPopupClose = popup.once("popup-closed"); popup.hidePopup(); diff --git a/devtools/client/shared/test/browser_cubic-bezier-02.js b/devtools/client/shared/test/browser_cubic-bezier-02.js index 3ce0af2f99..55fcb39c83 100644 --- a/devtools/client/shared/test/browser_cubic-bezier-02.js +++ b/devtools/client/shared/test/browser_cubic-bezier-02.js @@ -103,7 +103,7 @@ async function curveCanBeClicked(widget, win, doc, offsets) { is(bezier.P1[1], 0.75, "P1 progress coordinate remained unchanged"); } -async function pointsCanBeMovedWithKeyboard(widget, win, doc, offsets) { +async function pointsCanBeMovedWithKeyboard(widget) { info("Checking that points respond to keyboard events"); const singleStep = 3; diff --git a/devtools/client/shared/test/browser_cubic-bezier-06.js b/devtools/client/shared/test/browser_cubic-bezier-06.js index 9cb00e8bf7..269610b69f 100644 --- a/devtools/client/shared/test/browser_cubic-bezier-06.js +++ b/devtools/client/shared/test/browser_cubic-bezier-06.js @@ -63,7 +63,7 @@ function adjustingBezierUpdatesPreset(widget, win, doc, rect) { is(widget.presets._activePreset, null, "There is no active preset"); } -async function selectingPresetUpdatesBezier(widget, win, doc, rect) { +async function selectingPresetUpdatesBezier(widget, win, doc) { info("Checking that selecting a preset updates bezier curve"); info("Listening for the new coordinates event"); diff --git a/devtools/client/shared/test/browser_dbg_listworkers.js b/devtools/client/shared/test/browser_dbg_listworkers.js index fcdcf8e5dd..fc54139134 100644 --- a/devtools/client/shared/test/browser_dbg_listworkers.js +++ b/devtools/client/shared/test/browser_dbg_listworkers.js @@ -42,7 +42,7 @@ add_task(async function test() { is(workers[1].url, WORKER2_URL); onWorkerListChanged = waitForWorkerListChanged(target); - await SpecialPowers.spawn(tab.linkedBrowser, [WORKER2_URL], workerUrl => { + await SpecialPowers.spawn(tab.linkedBrowser, [WORKER2_URL], () => { content.worker1.terminate(); }); await onWorkerListChanged; @@ -52,7 +52,7 @@ add_task(async function test() { is(workers[0].url, WORKER2_URL); onWorkerListChanged = waitForWorkerListChanged(target); - await SpecialPowers.spawn(tab.linkedBrowser, [WORKER2_URL], workerUrl => { + await SpecialPowers.spawn(tab.linkedBrowser, [WORKER2_URL], () => { content.worker2.terminate(); }); await onWorkerListChanged; diff --git a/devtools/client/shared/test/browser_inplace-editor-01.js b/devtools/client/shared/test/browser_inplace-editor-01.js index b919fca946..e6bc604392 100644 --- a/devtools/client/shared/test/browser_inplace-editor-01.js +++ b/devtools/client/shared/test/browser_inplace-editor-01.js @@ -96,7 +96,7 @@ function testAdvanceCharCommit(doc) { createInplaceEditorAndClick( { advanceChars: ":", - start(editor) { + start() { EventUtils.sendString("Test:"); }, done: onDone("Test", true, resolve), @@ -114,7 +114,7 @@ function testAdvanceCharsFunction(doc) { createInplaceEditorAndClick( { initial: "", - advanceChars(charCode, text, insertionPoint) { + advanceChars(charCode, text) { if (charCode !== KeyboardEvent.DOM_VK_COLON) { return false; } @@ -126,7 +126,7 @@ function testAdvanceCharsFunction(doc) { // Just to make sure we check it somehow. return !!text.length; }, - start(editor) { + start() { for (const ch of ":Test:") { EventUtils.sendChar(ch); } diff --git a/devtools/client/shared/test/browser_key_shortcuts.js b/devtools/client/shared/test/browser_key_shortcuts.js index d48666ddca..6dafe3df2c 100644 --- a/devtools/client/shared/test/browser_key_shortcuts.js +++ b/devtools/client/shared/test/browser_key_shortcuts.js @@ -438,7 +438,7 @@ async function testTabCharacterShortcut(shortcuts) { info("Test tab character shortcut"); - once(shortcuts, "CmdOrCtrl+Alt+I", event => { + once(shortcuts, "CmdOrCtrl+Alt+I", () => { ok(false, "This handler must not be executed"); }); diff --git a/devtools/client/shared/test/browser_spectrum.js b/devtools/client/shared/test/browser_spectrum.js index 6189b1f0af..32ed6a79e0 100644 --- a/devtools/client/shared/test/browser_spectrum.js +++ b/devtools/client/shared/test/browser_spectrum.js @@ -245,12 +245,7 @@ function setSpectrumProps(spectrum, props, updateUI = true) { } } -function testAriaAttributesOnSpectrumElements( - spectrum, - colorName, - rgbString, - alpha -) { +function testAriaAttributesOnSpectrumElements(spectrum, colorName, rgbString) { for (const slider of [spectrum.dragger, spectrum.hueSlider]) { is( slider.getAttribute("aria-describedby"), diff --git a/devtools/client/shared/test/browser_tableWidget_basic.js b/devtools/client/shared/test/browser_tableWidget_basic.js index a8b737b9d0..5cdf67206e 100644 --- a/devtools/client/shared/test/browser_tableWidget_basic.js +++ b/devtools/client/shared/test/browser_tableWidget_basic.js @@ -1,6 +1,9 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ +// We test sorting of strings, which Assert.greater/less etc. don't do. +/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */ + // Tests that the table widget api works fine "use strict"; diff --git a/devtools/client/shared/test/browser_telemetry_button_eyedropper.js b/devtools/client/shared/test/browser_telemetry_button_eyedropper.js index 88d019de91..0606cec886 100644 --- a/devtools/client/shared/test/browser_telemetry_button_eyedropper.js +++ b/devtools/client/shared/test/browser_telemetry_button_eyedropper.js @@ -23,7 +23,7 @@ add_task(async function () { gBrowser.removeCurrentTab(); }); -async function testButton(toolbox, Telemetry) { +async function testButton(toolbox) { info("Calling the eyedropper button's callback"); // We call the button callback directly because we don't need to test the UI here, we're // only concerned about testing the telemetry probe. diff --git a/devtools/client/shared/test/browser_treeWidget_basic.js b/devtools/client/shared/test/browser_treeWidget_basic.js index 48702b9b8d..bc52a07c8e 100644 --- a/devtools/client/shared/test/browser_treeWidget_basic.js +++ b/devtools/client/shared/test/browser_treeWidget_basic.js @@ -34,7 +34,7 @@ add_task(async function () { gBrowser.removeCurrentTab(); }); -function populateTree(tree, doc) { +function populateTree(tree) { tree.add([ { id: "level1", @@ -179,7 +179,7 @@ function testTreeItemInsertedCorrectly(tree, doc) { /** * Populate the unsorted tree. */ -function populateUnsortedTree(tree, doc) { +function populateUnsortedTree(tree) { tree.sorted = false; tree.add([{ id: "g-1", label: "g-1" }]); @@ -191,7 +191,7 @@ function populateUnsortedTree(tree, doc) { /** * Test if the nodes are inserted correctly in the unsorted tree. */ -function testUnsortedTreeItemInsertedCorrectly(tree, doc) { +function testUnsortedTreeItemInsertedCorrectly(tree) { ok(tree.root.items.has("g-1"), "g-1 top level element exists"); is( diff --git a/devtools/client/shared/test/doc_event-listeners-01.html b/devtools/client/shared/test/doc_event-listeners-01.html index 5a9c2d53b6..653676b623 100644 --- a/devtools/client/shared/test/doc_event-listeners-01.html +++ b/devtools/client/shared/test/doc_event-listeners-01.html @@ -15,19 +15,19 @@ "use strict"; window.addEventListener("load", function() { - function initialSetup(event) { + function initialSetup() { // eslint-disable-next-line no-debugger debugger; const button = document.querySelector("button"); button.onclick = clickHandler; } - function clickHandler(event) { + function clickHandler() { window.foobar = "clickHandler"; } - function changeHandler(event) { + function changeHandler() { window.foobar = "changeHandler"; } - function keyupHandler(event) { + function keyupHandler() { window.foobar = "keyupHandler"; } diff --git a/devtools/client/shared/test/doc_event-listeners-03.html b/devtools/client/shared/test/doc_event-listeners-03.html index 2660f9f141..1d45b575e1 100644 --- a/devtools/client/shared/test/doc_event-listeners-03.html +++ b/devtools/client/shared/test/doc_event-listeners-03.html @@ -17,14 +17,14 @@ "use strict"; window.addEventListener("load", function() { - function initialSetup(event) { + function initialSetup() { const button = document.getElementById("initialSetup"); button.removeEventListener("click", initialSetup); // eslint-disable-next-line no-debugger debugger; } - function clicker(event) { + function clicker() { window.foobar = "clicker"; } diff --git a/devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html b/devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html index 7917c82411..d31aa30e73 100644 --- a/devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html +++ b/devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html @@ -2,7 +2,7 @@