tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 2a90cd0fc9ad47173b019981ca62dfff459d6d17
parent cf9c3d6f4753a2f4a7f44392866097c803ba8efd
Author: Dão Gottwald <dao@mozilla.com>
Date:   Fri, 19 Dec 2025 14:18:05 +0000

Bug 2006855 - Make browser_content_command_insert_text.js work with the new search bar implementation. r=mbeier

Differential Revision: https://phabricator.services.mozilla.com/D276977

Diffstat:
Meditor/libeditor/tests/browser_content_command_insert_text.js | 21+++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/editor/libeditor/tests/browser_content_command_insert_text.js b/editor/libeditor/tests/browser_content_command_insert_text.js @@ -14,9 +14,6 @@ const gDOMWindowUtils = EventUtils._getDOMWindowUtils(window); let searchBar; add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.search.widget.new", false]], - }); searchBar = await gCUITestUtils.addSearchBar(); registerCleanupFunction(() => { gCUITestUtils.removeSearchBar(); @@ -25,11 +22,11 @@ add_setup(async function () { function promiseResettingSearchBarAndFocus() { const waitForFocusInSearchBar = BrowserTestUtils.waitForEvent( - searchBar.textbox, + searchBar.inputField, "focus" ); - searchBar.textbox.focus(); - searchBar.textbox.value = ""; + searchBar.inputField.focus(); + searchBar.inputField.value = ""; return Promise.all([ waitForFocusInSearchBar, TestUtils.waitForCondition( @@ -67,11 +64,11 @@ add_task(async function test_text_editor_in_chrome() { function logEvent(event) { events.push(event); } - searchBar.textbox.addEventListener("beforeinput", logEvent); + searchBar.inputField.addEventListener("beforeinput", logEvent); gDOMWindowUtils.sendContentCommandEvent("insertText", null, "XYZ"); is( - searchBar.textbox.value, + searchBar.inputField.value, "XYZ", "The string should be inserted into the focused search bar" ); @@ -83,9 +80,9 @@ add_task(async function test_text_editor_in_chrome() { is(events[0]?.inputType, "insertText", 'inputType should be "insertText"'); is(events[0]?.data, "XYZ", 'inputType should be "XYZ"'); is(events[0]?.cancelable, true, "beforeinput event should be cancelable"); - searchBar.textbox.removeEventListener("beforeinput", logEvent); + searchBar.inputField.removeEventListener("beforeinput", logEvent); - searchBar.textbox.blur(); + searchBar.inputField.blur(); }); add_task(async function test_text_editor_in_content() { @@ -173,7 +170,7 @@ add_task(async function test_text_editor_in_content() { }); is( - searchBar.textbox.value, + searchBar.inputField.value, "", "The string should not be inserted into the previously focused search bar" ); @@ -267,7 +264,7 @@ add_task(async function test_html_editor_in_content() { }); is( - searchBar.textbox.value, + searchBar.inputField.value, "", "The string should not be inserted into the previously focused search bar" );