Skip to content

Commit

Permalink
Bug 1864221 - Pt.1 Add exceptions from a11y_checks for 3 tests clicki…
Browse files Browse the repository at this point in the history
…ng on disabled controls in Webextensions. r=Jamie,extension-reviewers,rpl

We intentionally turn off a11y_checks for these click events, because the clicks in the patch are targeting disabled controls to confirm the click events won't come through. These clicks are not meant to be interactive and are not expected to be accessible.

Thus, we are excluding this click event from accessibility checks and removing the fail-if annotation that was added by bug 1854460 before the investigation in the meta bug 1854461.

Differential Revision: https://phabricator.services.mozilla.com/D193329
  • Loading branch information
anna-yeddi committed Nov 15, 2023
1 parent a8c3525 commit a53e4bc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
3 changes: 0 additions & 3 deletions browser/components/extensions/test/browser/browser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ skip-if = [
skip-if = ["os == 'linux'"] # bug 1369197

["browser_ext_browserAction_disabled.js"]
fail-if = ["a11y_checks"] # Bug 1854460 clicked unified-extensions-item-action-button(s) may not be accessible

["browser_ext_browserAction_experiment.js"]

Expand All @@ -102,7 +101,6 @@ fail-if = ["a11y_checks"] # Bug 1854460 clicked unified-extensions-item-action-b
["browser_ext_browserAction_popup_port.js"]

["browser_ext_browserAction_popup_preload.js"]
fail-if = ["a11y_checks"] # Bug 1854460 clicked body and unified-extensions-item-action-button may not be accessible
skip-if = [
"os == 'win' && !debug",
"verify && debug && os == 'mac'", # bug 1352668
Expand Down Expand Up @@ -262,7 +260,6 @@ https_first_disabled = true
["browser_ext_menus_activeTab.js"]

["browser_ext_menus_capture_secondary_click.js"]
fail-if = ["a11y_checks"] # Bug 1854460 clicked menuitem(s) may not be accessible

["browser_ext_menus_errors.js"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,31 @@ add_task(async function testDisabled() {
extension.sendMessage("check-clicked", false);
await extension.awaitMessage("next-test");

// We intentionally turn off this a11y check, because the following click
// is targeting a disabled control to confirm the click event won't come through.
// It is not meant to be interactive and is not expected to be accessible:
AccessibilityUtils.setEnv({
mustBeEnabled: false,
});
await clickBrowserAction(extension, window, { button: 1 });
await new Promise(resolve => setTimeout(resolve, 0));
AccessibilityUtils.resetEnv();

extension.sendMessage("check-clicked", false);
await extension.awaitMessage("next-test");

let widget = getBrowserActionWidget(extension);
CustomizableUI.addWidgetToArea(widget.id, getCustomizableUIPanelID());

// We intentionally turn off this a11y check, because the following click
// is targeting a disabled control to confirm the click event won't come through.
// It is not meant to be interactive and is not expected to be accessible:
AccessibilityUtils.setEnv({
mustBeEnabled: false,
});
await clickBrowserAction(extension, window, { button: 1 });
await new Promise(resolve => setTimeout(resolve, 0));
AccessibilityUtils.resetEnv();

extension.sendMessage("check-clicked", false);
await extension.awaitMessage("next-test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,18 @@ add_task(async function testBrowserActionDisabled() {
}
);

// We intentionally turn off a11y_checks, because the following click
// is targeting a disabled control to confirm the click event won't come through.
// It is not meant to be interactive and is not expected to be accessible:
AccessibilityUtils.setEnv({
mustBeEnabled: false,
});
EventUtils.synthesizeMouseAtCenter(
widget.node,
{ type: "mouseup", button: 0 },
window
);
AccessibilityUtils.resetEnv();

await mouseUpPromise;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ add_task(async function test_disabled_item() {
for (let button of [0, 1, 2]) {
const menu = await openContextMenu();
const items = menu.getElementsByAttribute("label", "disabled_item");
// We intentionally turn off this a11y check, because the following click
// is targeting a disabled control to confirm the click event won't come through.
// It is not meant to be interactive and is not expected to be accessible:
AccessibilityUtils.setEnv({
mustBeEnabled: false,
});
await EventUtils.synthesizeMouseAtCenter(items[0], { button });
AccessibilityUtils.resetEnv();
await closeContextMenu();
await extension.awaitMessage("onHidden");
}
Expand Down

0 comments on commit a53e4bc

Please sign in to comment.