From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- .../preferences/tests/browser_keyboardfocus.js | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'browser/components/preferences/tests/browser_keyboardfocus.js') 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" ); -- cgit v1.2.3