From 816266333a8e1ee2ab4a6a34c7574dcc2e3d478b Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Mon, 21 Oct 2024 13:52:55 +0000 Subject: [PATCH] Bug 1925846 - Fix test_accounts_config.js so that it doesn't fail when run by Thunderbird. r=markh Differential Revision: https://phabricator.services.mozilla.com/D226264 --- .../tests/xpcshell/test_accounts_config.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/services/fxaccounts/tests/xpcshell/test_accounts_config.js b/services/fxaccounts/tests/xpcshell/test_accounts_config.js index b0523110d72b..feefbc6d921d 100644 --- a/services/fxaccounts/tests/xpcshell/test_accounts_config.js +++ b/services/fxaccounts/tests/xpcshell/test_accounts_config.js @@ -6,6 +6,9 @@ const { FxAccounts } = ChromeUtils.importESModule( "resource://gre/modules/FxAccounts.sys.mjs" ); +const { CLIENT_IS_THUNDERBIRD } = ChromeUtils.importESModule( + "resource://gre/modules/FxAccountsCommon.sys.mjs" +); add_task( async function test_non_https_remote_server_uri_with_requireHttps_false() { @@ -28,7 +31,10 @@ add_task( Assert.equal(url.searchParams.get("service"), "sync"); Assert.equal(url.searchParams.get("entrypoint"), "test"); Assert.equal(url.searchParams.get("action"), "email"); - Assert.equal(url.searchParams.get("client_id"), "5882386c6d801776"); + Assert.equal( + url.searchParams.get("client_id"), + CLIENT_IS_THUNDERBIRD ? "8269bacd7bbc7f80" : "5882386c6d801776" + ); Assert.equal(url.searchParams.get("response_type"), "code"); Services.prefs.clearUserPref("identity.fxaccounts.remote.root"); @@ -72,6 +78,11 @@ add_task(async function test_is_production_config() { add_task(async function test_promise_account_service_param() { ensureOauthNotConfigured(); + Services.prefs.setStringPref("identity.fxaccounts.autoconfig.uri", ""); + Services.prefs.setStringPref( + "identity.fxaccounts.remote.root", + "https://accounts.firefox.com/" + ); Assert.equal( await FxAccounts.config.promiseConnectAccountURI("test", { service: "custom-service", @@ -85,7 +96,10 @@ add_task(async function test_promise_account_service_param() { }) ); Assert.equal(url.searchParams.get("context"), "oauth_webchannel_v1"); - Assert.equal(url.searchParams.get("client_id"), "5882386c6d801776"); + Assert.equal( + url.searchParams.get("client_id"), + CLIENT_IS_THUNDERBIRD ? "8269bacd7bbc7f80" : "5882386c6d801776" + ); Assert.equal(url.searchParams.get("service"), "custom-service"); resetOauthConfig(); });