Commit 83651996 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml/tests: Fix Number toLocaleString test on updated Win 8.1.

parent 950c2da6
......@@ -150,10 +150,14 @@ sync_test("Number toLocaleString", function() {
];
if(external.isEnglish) {
for(var i = 0; i < tests.length; i++) {
r = Number.prototype.toLocaleString.call(tests[i][0]);
ok(r === tests[i][1], "[" + i + "] got " + r);
}
/* Some recent Win8.1 updates have old jscript behavior */
if(Number.prototype.toLocaleString.call(0.0) === "0.00")
win_skip("skipping tests due to old behavior");
else
for(var i = 0; i < tests.length; i++) {
r = Number.prototype.toLocaleString.call(tests[i][0]);
ok(r === tests[i][1], "[" + i + "] got " + r);
}
}
try {
......@@ -161,21 +165,24 @@ sync_test("Number toLocaleString", function() {
ok(false, "expected exception calling it on string");
}catch(ex) {
var n = ex.number >>> 0;
ok(n === JS_E_WRONG_THIS, "called on string threw " + n);
ok(n === JS_E_WRONG_THIS || broken(n === JS_E_NUMBER_EXPECTED) /* newer Win8.1 */,
"called on string threw " + n);
}
try {
Number.prototype.toLocaleString.call(undefined);
ok(false, "expected exception calling it on undefined");
}catch(ex) {
var n = ex.number >>> 0;
ok(n === JS_E_WRONG_THIS, "called on undefined threw " + n);
ok(n === JS_E_WRONG_THIS || broken(n === JS_E_NUMBER_EXPECTED) /* newer Win8.1 */,
"called on undefined threw " + n);
}
try {
Number.prototype.toLocaleString.call(external.nullDisp);
ok(false, "expected exception calling it on nullDisp");
}catch(ex) {
var n = ex.number >>> 0;
ok(n === JS_E_WRONG_THIS, "called on nullDisp threw " + n);
ok(n === JS_E_WRONG_THIS || broken(n === JS_E_NUMBER_EXPECTED) /* newer Win8.1 */,
"called on nullDisp threw " + n);
}
});
......
......@@ -54,6 +54,11 @@ function win_skip(m) {
external.win_skip(m);
}
function broken(e)
{
return external.broken(e);
}
function reportSuccess() {
external.reportSuccess();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment