Bug 1602075 - only highlight the accessibility tab when the auto init feature is not enabled. r=mtigley

Differential Revision: https://phabricator.services.mozilla.com/D71585
This commit is contained in:
Yura Zenevich 2020-04-23 14:40:10 +00:00
parent 3e530c3cb3
commit 8cbcad7381
2 changed files with 10 additions and 0 deletions

View File

@ -96,6 +96,12 @@ class AccessibilityStartup {
* accessibility service is initialized or shutdown.
*/
async _updateToolHighlight() {
// Only update the tab highlighted state when the panel can be
// enabled/disabled manually.
if (this.accessibilityProxy.supports.autoInit) {
return;
}
const isHighlighted = await this.toolbox.isToolHighlighted("accessibility");
if (this.accessibilityProxy.enabled && !isHighlighted) {
this.toolbox.highlightTool("accessibility");

View File

@ -6,6 +6,7 @@
const TEST_URI = '<h1 id="h1">header</h1><p id="p">paragraph</p>';
add_task(async function tabNotHighlighted() {
Services.prefs.setBoolPref("devtools.accessibility.auto-init.enabled", false);
await addTab(buildURL(TEST_URI));
const { toolbox } = await openInspector();
const isHighlighted = await toolbox.isToolHighlighted("accessibility");
@ -17,9 +18,11 @@ add_task(async function tabNotHighlighted() {
);
gBrowser.removeCurrentTab();
Services.prefs.clearUserPref("devtools.accessibility.auto-init.enabled");
});
add_task(async function tabHighlighted() {
Services.prefs.setBoolPref("devtools.accessibility.auto-init.enabled", false);
let a11yService = await initA11y();
ok(a11yService, "Accessibility service was started");
await addTab(buildURL(TEST_URI));
@ -28,4 +31,5 @@ add_task(async function tabHighlighted() {
a11yService = null;
gBrowser.removeCurrentTab();
Services.prefs.clearUserPref("devtools.accessibility.auto-init.enabled");
});