basic.js (964B)
1 // Copyright 2022 Igalia S.L. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-Intl.DurationFormat.supportedLocalesOf 6 description: Tests that Intl.DurationFormat has a supportedLocalesOf property, and it works as expected. 7 features: [Intl.DurationFormat] 8 ---*/ 9 10 assert.sameValue(typeof Intl.DurationFormat.supportedLocalesOf, "function", 11 "supportedLocalesOf should be supported."); 12 13 const defaultLocale = new Intl.DurationFormat().resolvedOptions().locale; 14 const notSupported = "zxx"; // "no linguistic content" 15 const requestedLocales = [defaultLocale, notSupported]; 16 17 const supportedLocales = Intl.DurationFormat.supportedLocalesOf(requestedLocales); 18 assert.sameValue(supportedLocales.length, 1, "The length of the supported locales list should be 1"); 19 assert.sameValue(supportedLocales[0], defaultLocale, "The default locale is returned in the supported list."); 20 21 reportCompare(0, 0);