tor-browser

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

commit 78703903abbf1c0ebc4b833dee0d46f0b3d2524d
parent 9de5df00a5ebee8a62b4995d4c5dfbc8f2aa927a
Author: Eitan Isaacson <eitan@monotonous.org>
Date:   Wed, 15 Oct 2025 17:15:11 +0000

Bug 1994029 - P1: Introduce atk action test. r=Jamie

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

Diffstat:
Maccessible/tests/browser/atk/browser.toml | 2++
Aaccessible/tests/browser/atk/browser_action.js | 30++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/accessible/tests/browser/atk/browser.toml b/accessible/tests/browser/atk/browser.toml @@ -13,6 +13,8 @@ prefs = [ "security.allow_eval_with_system_principal=true" ] +["browser_action.js"] + ["browser_atspi_interfaces.js"] ["browser_groupPosition.js"] diff --git a/accessible/tests/browser/atk/browser_action.js b/accessible/tests/browser/atk/browser_action.js @@ -0,0 +1,30 @@ +/* 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/. */ + +"use strict"; + +/** + * Test basic press action. + */ +addAccessibleTask( + ` +<button id="btn" onclick="this.textContent = 'Clicked'">Click me</button> + `, + async function () { + const actions = await runPython(` + global doc + doc = getDoc() + global btn + btn = findByDomId(doc, "btn").queryAction() + return str([[btn.getName(i), btn.getLocalizedName(i), btn.getDescription(i)] for i in range(btn.get_nActions())]) + `); + is(actions, "[['press', '', 'Press']]", "btn has correct actions"); + + const nameChanged = waitForEvent(EVENT_NAME_CHANGE, "btn"); + await runPython(` + btn.doAction(0) + `); + await nameChanged; + } +);