From 7069822ab03c425676187eadca1d8e0d84ff3b5b Mon Sep 17 00:00:00 2001 From: Luca Greco Date: Sun, 2 Jul 2023 16:15:50 +0000 Subject: [PATCH] Bug 1841381 - Fix browser_html_detail_view.js betasim perma failure. r=extension-reviewers,robwu The test was accessing the role DOM attribute as a property of the DOM element, reflecting that DOM attribute into a DOM element property is currently gated by the "accessibility.ARIAReflection.enabled" pref (which is currently set to true only in Nightly). The perma failure while running on beta is fixed by this patch by accessing the role DOM attribute using getAttribute (which works as expected on both nightly and beta builds). Differential Revision: https://phabricator.services.mozilla.com/D182633 --- .../extensions/test/browser/browser_html_detail_view.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/toolkit/mozapps/extensions/test/browser/browser_html_detail_view.js b/toolkit/mozapps/extensions/test/browser/browser_html_detail_view.js index 55015c24cb6f..d76ad700cd99 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_html_detail_view.js +++ b/toolkit/mozapps/extensions/test/browser/browser_html_detail_view.js @@ -44,7 +44,7 @@ async function checkLabel(row, name) { await doc.l10n.translateElements([row]); const rowHeaderEl = row.firstElementChild; is(doc.l10n.getAttributes(rowHeaderEl).id, id, `The ${name} label is set`); - if (row.role === "group") { + if (row.getAttribute("role") === "group") { // For the rows on which the role="group" attribute is set, // let's make sure that the element itself includes an aria-label // which provides to the screen reader a label similar to the one @@ -79,7 +79,11 @@ async function checkRowScreenReaderAccessibility( // to the fluent ids (which would make translateElements to reject // and the test to fail explicitly). await doc.l10n.translateElements([row]); - is(row.role, "group", `Expect ${groupName} row to have role group`); + is( + row.getAttribute("role"), + "group", + `Expect ${groupName} row to have role group` + ); is( doc.l10n.getAttributes(row).id, expectedFluentId,