| 1 |
// Copyright 2016 Mozilla Corporation. All rights reserved. |
| 2 |
// This code is governed by the license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
esid: sec-Intl.PluralRules.supportedLocalesOf |
| 6 |
description: > |
| 7 |
Tests that Intl.PluralRules has a supportedLocalesOf property, and |
| 8 |
it works as planned. |
| 9 |
author: Zibi Braniecki |
| 10 |
---*/ |
| 11 |
|
| 12 |
var defaultLocale = new Intl.PluralRules().resolvedOptions().locale; |
| 13 |
var notSupported = 'zxx'; // "no linguistic content" |
| 14 |
var requestedLocales = [defaultLocale, notSupported]; |
| 15 |
|
| 16 |
var supportedLocales; |
| 17 |
|
| 18 |
assert(Intl.PluralRules.hasOwnProperty('supportedLocalesOf'), "Intl.PluralRules doesn't have a supportedLocalesOf property."); |
| 19 |
|
| 20 |
supportedLocales = Intl.PluralRules.supportedLocalesOf(requestedLocales); |
| 21 |
assert.sameValue(supportedLocales.length, 1, 'The length of supported locales list is not 1.'); |
| 22 |
|
| 23 |
assert.sameValue(supportedLocales[0], defaultLocale, 'The default locale is not returned in the supported list.'); |