browser_checkspelling.js (973B)
1 add_task(async function () { 2 SpecialPowers.pushPrefEnv({ set: [["layout.spellcheckDefault", 2]] }); 3 4 let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", { 5 leaveOpen: true, 6 }); 7 is(prefs.selectedPane, "paneGeneral", "General pane was selected"); 8 9 let doc = gBrowser.contentDocument; 10 let checkbox = doc.querySelector("#checkSpelling"); 11 is( 12 checkbox.checked, 13 Services.prefs.getIntPref("layout.spellcheckDefault") == 2, 14 "checkbox should represent pref value before clicking on checkbox" 15 ); 16 ok( 17 checkbox.checked, 18 "checkbox should be checked before clicking on checkbox" 19 ); 20 21 checkbox.click(); 22 23 is( 24 checkbox.checked, 25 Services.prefs.getIntPref("layout.spellcheckDefault") == 2, 26 "checkbox should represent pref value after clicking on checkbox" 27 ); 28 ok( 29 !checkbox.checked, 30 "checkbox should not be checked after clicking on checkbox" 31 ); 32 33 BrowserTestUtils.removeTab(gBrowser.selectedTab); 34 });