Bug 1737131 - Make sure to show the overflow menu in browser_ext_browserAction_theme_icons.js. r=extension-reviewers,zombie

I dug into the test failures above and this is because we return wrong
styles, because the overflow panel was never opened and thus the styles
we were querying are disconnected from the document.

Bug 1483798 covers not returning a style for these elements (patch there
incoming).

Differential Revision: https://phabricator.services.mozilla.com/D131075
This commit is contained in:
Emilio Cobos Álvarez 2021-11-14 12:40:43 +00:00
Родитель 4456ebd295
Коммит 706cca12e0
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -79,9 +79,6 @@ skip-if = debug # Bug 1522164
[browser_ext_browserAction_simple.js]
[browser_ext_browserAction_telemetry.js]
[browser_ext_browserAction_theme_icons.js]
skip-if =
os == 'linux' && devedition # Bug 1737131
os == 'mac' # macosx1014 due to 1479256
[browser_ext_browsingData_cookieStoreId.js]
[browser_ext_browsingData_formData.js]
[browser_ext_browsingData_history.js]

Просмотреть файл

@ -21,9 +21,10 @@ async function testBrowserAction(extension, expectedIcon) {
let browserActionWidget = getBrowserActionWidget(extension);
await promiseAnimationFrame();
let browserActionButton = browserActionWidget.forWindow(window).node;
let image = getListStyleImage(browserActionButton);
ok(
getListStyleImage(browserActionButton).includes(expectedIcon),
`Expected browser action icon to be ${expectedIcon}`
image.includes(expectedIcon),
`Expected browser action icon (${image}) to be ${expectedIcon}`
);
}
@ -256,6 +257,11 @@ add_task(async function browseraction_theme_icons_overflow_panel() {
},
],
});
// Ensure we show the menupanel at least once. This makes sure that the
// elements we're going to query the style of are in the flat tree.
document.getElementById("nav-bar-overflow-button").click();
await testStaticTheme({
themeData,
expectedIcon: "light",