summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/chrome/test_intlUtils_isAppLocaleRTL.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/tests/mochitest/chrome/test_intlUtils_isAppLocaleRTL.html')
-rw-r--r--dom/tests/mochitest/chrome/test_intlUtils_isAppLocaleRTL.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/dom/tests/mochitest/chrome/test_intlUtils_isAppLocaleRTL.html b/dom/tests/mochitest/chrome/test_intlUtils_isAppLocaleRTL.html
new file mode 100644
index 0000000000..fc6e8e2fb4
--- /dev/null
+++ b/dom/tests/mochitest/chrome/test_intlUtils_isAppLocaleRTL.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1673054
+-->
+<head>
+ <title>Test for Bug 1673054 </title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
+</head>
+<body onload="test()">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1673054 ">Mozilla Bug 1673054</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+<script>
+async function test() {
+ SimpleTest.waitForExplicitFinish();
+
+ let intlUtils = window.intlUtils;
+ ok(intlUtils, "window.intlUtils should exist");
+
+ let originalValue = intlUtils.isAppLocaleRTL();
+ ok(originalValue == false, "window.intlUtils.isAppLocaleRTL should exist");
+
+ await SpecialPowers.pushPrefEnv({ set: [["intl.l10n.pseudo", "bidi"]] });
+ let currentValue = intlUtils.isAppLocaleRTL();
+ ok(currentValue == true, "If pseudolocale is bidi, isAppLocaleRTL should be true");
+
+ await SpecialPowers.clearUserPref("intl.l10n.pseudo");
+ currentValue = intlUtils.isAppLocaleRTL();
+ ok(originalValue == currentValue, "Without override, isAppLocaleRTL should be default");
+
+ SimpleTest.finish();
+}
+</script>
+</body>
+</html>