OLD | NEW |
1 // svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump tex
t + pixel results | 1 // svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump tex
t + pixel results |
2 if (self.testRunner) { | 2 if (self.testRunner) { |
3 if (self.enablePixelTesting) | 3 if (self.enablePixelTesting) |
4 testRunner.dumpAsTextWithPixelResults(); | 4 testRunner.dumpAsTextWithPixelResults(); |
5 else | 5 else |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 } | 7 } |
8 | 8 |
9 var description, debug, successfullyParsed; | 9 var description, debug, successfullyParsed; |
10 | 10 |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 function shouldBeZero(a, quiet) { shouldBe(a, "0", quiet); } | 406 function shouldBeZero(a, quiet) { shouldBe(a, "0", quiet); } |
407 | 407 |
408 function shouldBeEqualToString(a, b) | 408 function shouldBeEqualToString(a, b) |
409 { | 409 { |
410 if (typeof a !== "string" || typeof b !== "string") | 410 if (typeof a !== "string" || typeof b !== "string") |
411 debug("WARN: shouldBeEqualToString() expects string arguments"); | 411 debug("WARN: shouldBeEqualToString() expects string arguments"); |
412 var unevaledString = JSON.stringify(b); | 412 var unevaledString = JSON.stringify(b); |
413 shouldBe(a, unevaledString); | 413 shouldBe(a, unevaledString); |
414 } | 414 } |
415 | 415 |
| 416 function shouldBeEqualToNumber(a, b) |
| 417 { |
| 418 if (typeof a !== "string" || typeof b !== "number") |
| 419 debug("WARN: shouldBeEqualToNumber() expects a string and a number arguments
"); |
| 420 var unevaledString = JSON.stringify(b); |
| 421 shouldBe(a, unevaledString); |
| 422 } |
| 423 |
416 function shouldBeEmptyString(a) { shouldBeEqualToString(a, ""); } | 424 function shouldBeEmptyString(a) { shouldBeEqualToString(a, ""); } |
417 | 425 |
418 function shouldEvaluateTo(actual, expected) { | 426 function shouldEvaluateTo(actual, expected) { |
419 // A general-purpose comparator. 'actual' should be a string to be | 427 // A general-purpose comparator. 'actual' should be a string to be |
420 // evaluated, as for shouldBe(). 'expected' may be any type and will be | 428 // evaluated, as for shouldBe(). 'expected' may be any type and will be |
421 // used without being eval'ed. | 429 // used without being eval'ed. |
422 if (expected == null) { | 430 if (expected == null) { |
423 // Do this before the object test, since null is of type 'object'. | 431 // Do this before the object test, since null is of type 'object'. |
424 shouldBeNull(actual); | 432 shouldBeNull(actual); |
425 } else if (typeof expected == "undefined") { | 433 } else if (typeof expected == "undefined") { |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 testPassed = function(msg) { | 773 testPassed = function(msg) { |
766 workerPort.postMessage('PASS:' + msg); | 774 workerPort.postMessage('PASS:' + msg); |
767 }; | 775 }; |
768 finishJSTest = function() { | 776 finishJSTest = function() { |
769 workerPort.postMessage('DONE:'); | 777 workerPort.postMessage('DONE:'); |
770 }; | 778 }; |
771 debug = function(msg) { | 779 debug = function(msg) { |
772 workerPort.postMessage(msg); | 780 workerPort.postMessage(msg); |
773 }; | 781 }; |
774 } | 782 } |
OLD | NEW |