summaryrefslogtreecommitdiffstats
path: root/browser/components/preferences/tests/browser_keyboardfocus.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/preferences/tests/browser_keyboardfocus.js')
-rw-r--r--browser/components/preferences/tests/browser_keyboardfocus.js36
1 files changed, 19 insertions, 17 deletions
diff --git a/browser/components/preferences/tests/browser_keyboardfocus.js b/browser/components/preferences/tests/browser_keyboardfocus.js
index bed452b679..89576b926a 100644
--- a/browser/components/preferences/tests/browser_keyboardfocus.js
+++ b/browser/components/preferences/tests/browser_keyboardfocus.js
@@ -13,40 +13,42 @@ add_task(async function () {
let checkbox = gBrowser.contentDocument.querySelector(
"#useFullKeyboardNavigation"
);
- Assert.ok(
- !Services.prefs.getIntPref("accessibility.tabfocus", undefined),
- "no pref value should exist"
+ Assert.equal(
+ Services.prefs.getIntPref("accessibility.tabfocus"),
+ 7,
+ "default should be full keyboard access"
);
Assert.ok(
- !checkbox.checked,
- "checkbox should be unchecked before clicking on checkbox"
+ checkbox.checked,
+ "checkbox should be checked before clicking on checkbox"
);
checkbox.click();
Assert.equal(
Services.prefs.getIntPref("accessibility.tabfocus"),
- 7,
+ 1,
"Prefstore should reflect checkbox's associated numeric value"
);
Assert.ok(
- checkbox.checked,
- "checkbox should be checked after clicking on checkbox"
+ !checkbox.checked,
+ "checkbox should be unchecked after clicking on checkbox"
);
checkbox.click();
Assert.ok(
- !checkbox.checked,
- "checkbox should be unchecked after clicking on checkbox"
+ checkbox.checked,
+ "checkbox should be checked after clicking on checkbox"
);
- Assert.ok(
- !Services.prefs.getIntPref("accessibility.tabfocus", undefined),
- "No pref value should exist"
+ Assert.equal(
+ Services.prefs.getIntPref("accessibility.tabfocus"),
+ 7,
+ "Should restore default value"
);
BrowserTestUtils.removeTab(gBrowser.selectedTab);
- SpecialPowers.pushPrefEnv({ set: [["accessibility.tabfocus", 4]] });
+ await SpecialPowers.pushPrefEnv({ set: [["accessibility.tabfocus", 4]] });
await launchPreferences();
checkbox = gBrowser.contentDocument.querySelector(
"#useFullKeyboardNavigation"
@@ -57,20 +59,20 @@ add_task(async function () {
"checkbox should stay unchecked after setting non-7 pref value"
);
Assert.equal(
- Services.prefs.getIntPref("accessibility.tabfocus", 0),
+ Services.prefs.getIntPref("accessibility.tabfocus"),
4,
"pref should have value in store"
);
BrowserTestUtils.removeTab(gBrowser.selectedTab);
- SpecialPowers.pushPrefEnv({ set: [["accessibility.tabfocus", 7]] });
+ await SpecialPowers.pushPrefEnv({ set: [["accessibility.tabfocus", 7]] });
await launchPreferences();
checkbox = gBrowser.contentDocument.querySelector(
"#useFullKeyboardNavigation"
);
Assert.equal(
- Services.prefs.getIntPref("accessibility.tabfocus", 0),
+ Services.prefs.getIntPref("accessibility.tabfocus"),
7,
"Pref value should update after modification"
);