Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
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.NumberFormat has a supportedLocalesOf
6 * property, and it works as planned.
7 * @author: Roozbeh Pournader
8 */
10 var defaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
11 var notSupported = 'zxx'; // "no linguistic content"
12 var requestedLocales = [defaultLocale, notSupported];
14 var supportedLocales;
16 if (!Intl.NumberFormat.hasOwnProperty('supportedLocalesOf')) {
17 $ERROR("Intl.NumberFormat doesn't have a supportedLocalesOf property.");
18 }
20 supportedLocales = Intl.NumberFormat.supportedLocalesOf(requestedLocales);
21 if (supportedLocales.length !== 1) {
22 $ERROR('The length of supported locales list is not 1.');
23 }
25 if (supportedLocales[0] !== defaultLocale) {
26 $ERROR('The default locale is not returned in the supported list.');
27 }