summaryrefslogtreecommitdiffstats
path: root/browser/components/preferences/tests/browser_keyboardfocus.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /browser/components/preferences/tests/browser_keyboardfocus.js
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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"
);