зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1617455 - Use empty array for empty locale string. r=zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D65223 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
50de7581c8
Коммит
ff1e2ff383
|
@ -1210,8 +1210,10 @@ var Policies = {
|
|||
onBeforeAddons(manager, param) {
|
||||
if (Array.isArray(param)) {
|
||||
Services.locale.requestedLocales = param;
|
||||
} else {
|
||||
} else if (param) {
|
||||
Services.locale.requestedLocales = param.split(",");
|
||||
} else {
|
||||
Services.locale.requestedLocales = [];
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -45,3 +45,24 @@ add_task(async function test_requested_locale_string() {
|
|||
await localePromise;
|
||||
Services.locale.requestedLocales = originalLocales;
|
||||
});
|
||||
|
||||
add_task(async function test_system_locale_string() {
|
||||
let originalLocales = Services.locale.requestedLocales;
|
||||
|
||||
let localePromise = promiseLocaleChanged("und");
|
||||
Services.locale.requestedLocales = ["und"];
|
||||
await localePromise;
|
||||
|
||||
let systemLocale = Cc["@mozilla.org/intl/ospreferences;1"].getService(
|
||||
Ci.mozIOSPreferences
|
||||
).systemLocale;
|
||||
localePromise = promiseLocaleChanged(systemLocale);
|
||||
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
RequestedLocales: "",
|
||||
},
|
||||
});
|
||||
await localePromise;
|
||||
Services.locale.requestedLocales = originalLocales;
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче