fune/browser/components/preferences/in-content/tests/browser_layersacceleration.js
Mark Banner 01008c7d57 Bug 1412778 - Enable ESLint rule no-cpows-in-tests across the whole tree. r=florian
MozReview-Commit-ID: 8pidN7x6MYh

--HG--
extra : rebase_source : 6a0d6800091231fc1535223bd7fc6df0ba40d47b
2017-10-30 09:55:39 +00:00

23 lines
891 B
JavaScript

add_task(async function() {
SpecialPowers.pushPrefEnv({set: [
["gfx.direct2d.disabled", false],
["layers.acceleration.disabled", false]
]});
let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
is(prefs.selectedPane, "paneGeneral", "General pane was selected");
// eslint-disable-next-line mozilla/no-cpows-in-tests
let doc = gBrowser.contentDocument;
let checkbox = doc.querySelector("#allowHWAccel");
is(!checkbox.checked,
Services.prefs.getBoolPref("layers.acceleration.disabled"),
"checkbox should represent inverted pref value before clicking on checkbox");
checkbox.click();
is(!checkbox.checked,
Services.prefs.getBoolPref("layers.acceleration.disabled"),
"checkbox should represent inverted pref value after clicking on checkbox");
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
});