Bug 1418724 - part 5 - Update a couple of tests to be more tolerant of variations in the exact form of the OS regional prefs. r=gandalf

This commit is contained in:
Jonathan Kew 2017-11-21 11:04:04 +00:00
parent f793736782
commit f6276a6775
2 changed files with 11 additions and 3 deletions

View File

@ -20,7 +20,8 @@ const localeService =
Cc["@mozilla.org/intl/localeservice;1"].getService(Ci.mozILocaleService);
const mozIntl = Cc["@mozilla.org/mozintl;1"].getService(Ci.mozIMozIntl);
let rpLocale = localeService.getRegionalPrefsLocales()[0];
let rpLocale = localeService.negotiateLanguages(localeService.getRegionalPrefsLocales(),
localeService.getAvailableLocales())[0];
let testData = [
{

View File

@ -14,9 +14,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1337234
<div id="content" style="display: none">
<script>
let rpLocales = window.getRegionalPrefsLocales();
const Cc = Components.classes;
const Ci = Components.interfaces;
const localeService =
Cc["@mozilla.org/intl/localeservice;1"].getService(Ci.mozILocaleService);
let rpLocales = localeService.negotiateLanguages(window.getRegionalPrefsLocales(),
localeService.getAvailableLocales());
ok(rpLocales.length > 0, "getRegionalPrefsLocales returns at least one locale.");
is(rpLocales[0], "en-US", "The first regional prefs locale should be en-US.");
is(rpLocales[0], "en-US", "The first regional prefs locale should resolve to en-US.");
</script>
</body>