Files
sousa-gecko/devtools/client/responsive/test/browser/browser_tab_not_selected.js
T
Julian Descottes 0923d75a63 Bug 1872980 - [devtools] Disable focusableRule in browser_tab_not_selected.js r=nchevobbe,devtools-reviewers
Wrap the call to selectDevicePixelRatio with AccessibilityUtils.setEnv/resetEnv to avoid
intermittent a11y failures

Differential Revision: https://phabricator.services.mozilla.com/D268406
2025-10-13 15:48:01 +00:00

53 lines
1.5 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Verify RDM opens for the correct tab, even if it is not the currently
// selected tab.
const TEST_URL = "http://example.com/";
addRDMTask(
null,
async function () {
info("Open two tabs");
const tab1 = await addTab(TEST_URL);
const tab2 = await addTab(TEST_URL);
is(gBrowser.selectedTab, tab2, "The selected tab is tab2");
info("Open RDM for the non-selected tab");
const { ui } = await openRDM(tab1);
ok(!ResponsiveUIManager.isActiveForTab(tab2), "RDM is not opened on tab2");
// Not mandatory for the test to pass, but it is helpful to see the RDM tab
// for Try failure screenshots.
info("Select the first tab");
gBrowser.selectedTab = tab1;
info("Try to update the DPI");
// The click on the device pixel ratio select is intermittently flagged as
// not accessible. See Bug 1849028 for a11y issues in DevTools tests.
AccessibilityUtils.setEnv({
focusableRule: false,
});
await selectDevicePixelRatio(ui, 2);
const dppx = await waitForDevicePixelRatio(ui, 2, {
waitForTargetConfiguration: true,
});
is(dppx, 2, "Content has expected devicePixelRatio");
AccessibilityUtils.resetEnv();
const clientClosed = waitForClientClose(ui);
await removeTab(tab2);
await removeTab(tab1);
await clientClosed;
},
{ onlyPrefAndTask: true }
);