summaryrefslogtreecommitdiffstats
path: root/browser/components/preferences/tests/browser_fluent.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /browser/components/preferences/tests/browser_fluent.js
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/preferences/tests/browser_fluent.js')
-rw-r--r--browser/components/preferences/tests/browser_fluent.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/browser/components/preferences/tests/browser_fluent.js b/browser/components/preferences/tests/browser_fluent.js
new file mode 100644
index 0000000000..db2daecc4f
--- /dev/null
+++ b/browser/components/preferences/tests/browser_fluent.js
@@ -0,0 +1,40 @@
+function whenMainPaneLoadedFinished() {
+ return new Promise(function (resolve, reject) {
+ const topic = "main-pane-loaded";
+ Services.obs.addObserver(function observer(aSubject) {
+ Services.obs.removeObserver(observer, topic);
+ resolve();
+ }, topic);
+ });
+}
+
+// Temporary test for an experimental new localization API.
+// See bug 1402069 for details.
+add_task(async function () {
+ // The string is used only when `browserTabsRemoteAutostart` is true
+ if (!Services.appinfo.browserTabsRemoteAutostart) {
+ ok(true, "fake test to avoid harness complaining");
+ return;
+ }
+
+ await Promise.all([
+ openPreferencesViaOpenPreferencesAPI("general", { leaveOpen: true }),
+ whenMainPaneLoadedFinished(),
+ ]);
+
+ let doc = gBrowser.contentDocument;
+ await doc.l10n.ready;
+
+ let [msg] = await doc.l10n.formatMessages([{ id: "category-general" }]);
+
+ let elem = doc.querySelector(`#category-general`);
+
+ Assert.deepEqual(msg, {
+ value: null,
+ attributes: [
+ { name: "tooltiptext", value: elem.getAttribute("tooltiptext") },
+ ],
+ });
+
+ BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});