default-locale-shell.js (764B)
1 // |reftest| skip-if(!this.hasOwnProperty("Intl")||!xulRuntime.shell) 2 3 // js/src/tests/lib/tests.py sets the default locale to "en-US" for shell tests. 4 // Ensure it's correctly set in the runtime and for the Intl service constructors. 5 const defaultLocale = "en-US"; 6 7 assertEq(getDefaultLocale(), defaultLocale); 8 9 assertEq(new Intl.Collator().resolvedOptions().locale, defaultLocale); 10 assertEq(new Intl.DateTimeFormat().resolvedOptions().locale, defaultLocale); 11 assertEq(new Intl.NumberFormat().resolvedOptions().locale, defaultLocale); 12 assertEq(new Intl.PluralRules().resolvedOptions().locale, defaultLocale); 13 assertEq(new Intl.RelativeTimeFormat().resolvedOptions().locale, defaultLocale); 14 15 if (typeof reportCompare === "function") 16 reportCompare(true, true);