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.
michael@0 | 1 | // Copyright 2012 Mozilla Corporation. All rights reserved. |
michael@0 | 2 | // This code is governed by the license found in the LICENSE file. |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * @description Tests that the object returned by Intl.NumberFormat.prototype.resolvedOptions |
michael@0 | 6 | * has the right properties. |
michael@0 | 7 | * @author Norbert Lindenberg |
michael@0 | 8 | */ |
michael@0 | 9 | |
michael@0 | 10 | $INCLUDE("testIntl.js"); |
michael@0 | 11 | |
michael@0 | 12 | var actual = new Intl.NumberFormat().resolvedOptions(); |
michael@0 | 13 | |
michael@0 | 14 | var actual2 = new Intl.NumberFormat().resolvedOptions(); |
michael@0 | 15 | if (actual2 === actual) { |
michael@0 | 16 | $ERROR("resolvedOptions returned the same object twice."); |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | // this assumes the default values where the specification provides them |
michael@0 | 20 | mustHaveProperty(actual, "locale", isCanonicalizedStructurallyValidLanguageTag); |
michael@0 | 21 | mustHaveProperty(actual, "numberingSystem", isValidNumberingSystem); |
michael@0 | 22 | mustHaveProperty(actual, "style", ["decimal"]); |
michael@0 | 23 | mustNotHaveProperty(actual, "currency"); |
michael@0 | 24 | mustNotHaveProperty(actual, "currencyDisplay"); |
michael@0 | 25 | mustHaveProperty(actual, "minimumIntegerDigits", [1]); |
michael@0 | 26 | mustHaveProperty(actual, "minimumFractionDigits", [0]); |
michael@0 | 27 | mustHaveProperty(actual, "maximumFractionDigits", [3]); |
michael@0 | 28 | mustNotHaveProperty(actual, "minimumSignificantDigits"); |
michael@0 | 29 | mustNotHaveProperty(actual, "maximumSignificantDigits"); |
michael@0 | 30 | mustHaveProperty(actual, "useGrouping", [true]); |
michael@0 | 31 |