test_intlUtils_isAppLocaleRTL.html (1257B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1673054 5 --> 6 <head> 7 <title>Test for Bug 1673054 </title> 8 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> 10 </head> 11 <body onload="test()"> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1673054 ">Mozilla Bug 1673054</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 <script> 16 async function test() { 17 SimpleTest.waitForExplicitFinish(); 18 19 let intlUtils = window.intlUtils; 20 ok(intlUtils, "window.intlUtils should exist"); 21 22 let originalValue = intlUtils.isAppLocaleRTL(); 23 ok(originalValue == false, "window.intlUtils.isAppLocaleRTL should exist"); 24 25 await SpecialPowers.pushPrefEnv({ set: [["intl.l10n.pseudo", "bidi"]] }); 26 let currentValue = intlUtils.isAppLocaleRTL(); 27 ok(currentValue == true, "If pseudolocale is bidi, isAppLocaleRTL should be true"); 28 29 await SpecialPowers.clearUserPref("intl.l10n.pseudo"); 30 currentValue = intlUtils.isAppLocaleRTL(); 31 ok(originalValue == currentValue, "Without override, isAppLocaleRTL should be default"); 32 33 SimpleTest.finish(); 34 } 35 </script> 36 </body> 37 </html>