tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 7de886f333b2e9fadeff38ec4a715fbdbc2a9566
parent 6f57fc92161112489c1708f9ebe0c1da97ea72a8
Author: Dom <im.sekiel@gmail.com>
Date:   Mon,  1 Dec 2025 18:56:39 +0000

Bug 2000957 - Mocked fluent id in testCommonSettingControlPropertiesSet function to eliminate logspam errors. r=tgiles

Differential Revision: https://phabricator.services.mozilla.com/D273695

Diffstat:
Mbrowser/components/preferences/tests/chrome/head.js | 2+-
Mbrowser/components/preferences/tests/chrome/test_setting_control.html | 17+++++++++++++++++
Mbrowser/components/preferences/tests/chrome/test_setting_group.html | 17+++++++++++++++++
3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/browser/components/preferences/tests/chrome/head.js b/browser/components/preferences/tests/chrome/head.js @@ -12,7 +12,7 @@ * @type {TestSettingControlCommonPropertiesFunction} */ async function testCommonSettingControlPropertiesSet(renderTemplateFunction) { - const l10nId = "l10n ID"; + const l10nId = "l10n-test-id"; const l10nArgs = { foo: "bar" }; const iconSrc = "anicon.png"; const supportPage = "https://support.page"; diff --git a/browser/components/preferences/tests/chrome/test_setting_control.html b/browser/components/preferences/tests/chrome/test_setting_control.html @@ -50,6 +50,23 @@ } add_setup(async function setup() { + const mockL10nSource = L10nFileSource.createMock( + "test", + "app", + ["en-US"], + "/localization/{locale}/", + [ + { + path: "/localization/en-US/mock.ftl", + source: "l10n-test-id =\n .label = Test label", + }, + ] + ); + L10nRegistry.getInstance().registerSources([mockL10nSource]); + MozXULElement.insertFTLIfNeeded("mock.ftl"); + SimpleTest.registerCleanupFunction(() => { + L10nRegistry.getInstance().removeSources([mockL10nSource.name]); + }); testHelpers = new InputTestHelpers(); ({ html } = await testHelpers.setupLit()); testHelpers.setupTests({ diff --git a/browser/components/preferences/tests/chrome/test_setting_group.html b/browser/components/preferences/tests/chrome/test_setting_group.html @@ -55,6 +55,23 @@ } add_setup(async function setup() { + const mockL10nSource = L10nFileSource.createMock( + "test", + "app", + ["en-US"], + "/localization/{locale}/", + [ + { + path: "/localization/en-US/mock.ftl", + source: "l10n-test-id =\n .label = Test label", + }, + ] + ); + L10nRegistry.getInstance().registerSources([mockL10nSource]); + MozXULElement.insertFTLIfNeeded("mock.ftl"); + SimpleTest.registerCleanupFunction(() => { + L10nRegistry.getInstance().removeSources([mockL10nSource.name]); + }); testHelpers = new InputTestHelpers(); ({ html, nothing } = await testHelpers.setupLit()); testHelpers.setupTests({