Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // Copyright 2012 Google Inc. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /**
5 * @description Tests that Intl.Collator has a supportedLocalesOf
6 * property, and it works as planned.
7 */
9 var defaultLocale = new Intl.Collator().resolvedOptions().locale;
10 var notSupported = 'zxx'; // "no linguistic content"
11 var requestedLocales = [defaultLocale, notSupported];
13 var supportedLocales;
15 if (!Intl.Collator.hasOwnProperty('supportedLocalesOf')) {
16 $ERROR("Intl.Collator doesn't have a supportedLocalesOf property.");
17 }
19 supportedLocales = Intl.Collator.supportedLocalesOf(requestedLocales);
20 if (supportedLocales.length !== 1) {
21 $ERROR('The length of supported locales list is not 1.');
22 }
24 if (supportedLocales[0] !== defaultLocale) {
25 $ERROR('The default locale is not returned in the supported list.');
26 }