Backed out changeset 5d3bc5f2c41f (bug 1354055) for mass Android reftest failures

This commit is contained in:
Phil Ringnalda 2017-04-07 07:59:37 -07:00
parent ab87252d1a
commit a8bb90e93a
2 changed files with 6 additions and 11 deletions

View File

@ -15,12 +15,10 @@ OSPreferences::ReadSystemLocales(nsTArray<nsCString>& aLocaleList)
//XXX: This is a quite sizable hack to work around the fact that we cannot
// retrieve OS locale in C++ without reaching out to JNI.
// Once we fix this (bug 1337078), this hack should not be necessary.
//
//XXX: Notice, this value may be empty on an early read. In that case
// we won't add anything to the return list so that it doesn't get
// cached in mSystemLocales.
nsAdoptingCString locale = Preferences::GetCString("intl.locale.os");
if (!locale.IsEmpty()) {
nsAutoCString locale;
if (!NS_SUCCEEDED(Preferences::GetCString("intl.locale.os", &locale)) ||
locale.IsEmpty()) {
locale.AssignLiteral("en-US");
aLocaleList.AppendElement(locale);
}
return true;

View File

@ -45,7 +45,6 @@ add_test(function test_getAppLocalesAsLangTags() {
const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS";
const PREF_SELECTED_LOCALE = "general.useragent.locale";
const PREF_OS_LOCALE = "intl.locale.os";
const REQ_LOC_CHANGE_EVENT = "intl:requested-locales-changed";
add_test(function test_getRequestedLocales() {
@ -68,7 +67,6 @@ add_test(function test_getRequestedLocales_matchOS() {
Services.prefs.setBoolPref(PREF_MATCH_OS_LOCALE, false);
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "ar-IR");
Services.prefs.setCharPref(PREF_OS_LOCALE, "en-US");
const observer = {
observe: function (aSubject, aTopic, aData) {
@ -140,7 +138,6 @@ add_test(function test_isAppLocaleRTL() {
});
do_register_cleanup(() => {
Services.prefs.clearUserPref(PREF_SELECTED_LOCALE);
Services.prefs.clearUserPref(PREF_MATCH_OS_LOCALE);
Services.prefs.clearUserPref(PREF_OS_LOCALE, "en-US");
Services.prefs.clearUserPref(PREF_SELECTED_LOCALE);
Services.prefs.clearUserPref(PREF_MATCH_OS_LOCALE);
});