| 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 testPassed("Got expected error: '" + message + "'"); | 642 testPassed("Got expected error: '" + message + "'"); |
| 643 else | 643 else |
| 644 testFailed("Unexpected error '" + message + "'"); | 644 testFailed("Unexpected error '" + message + "'"); |
| 645 expectedErrorMessage = undefined; | 645 expectedErrorMessage = undefined; |
| 646 return; | 646 return; |
| 647 } | 647 } |
| 648 | 648 |
| 649 testFailed("expectError() not called before shouldHaveHadError()"); | 649 testFailed("expectError() not called before shouldHaveHadError()"); |
| 650 } | 650 } |
| 651 | 651 |
| 652 // With Oilpan tests that rely on garbage collection need to go through |
| 653 // the event loop in order to get precise garbage collections. Oilpan |
| 654 // uses conservative stack scanning when not at the event loop and that |
| 655 // can artificially keep objects alive. Therefore, tests that need to check |
| 656 // that something is dead need to use this asynchronous collectGarbage |
| 657 // function. |
| 658 function collectGarbage(callback) { |
| 659 // Perform multiple GCs to break sequences of Oilpan Persistent handles |
| 660 // or RefPtrs that will keep objects alive until the next GC. |
| 661 // FIXME: Oilpan: Once everything is moved to the oilpan heap we can |
| 662 // reduce the number of garbage collections. |
| 663 GCController.collect(); |
| 664 setTimeout(function() { |
| 665 GCController.collect(); |
| 666 setTimeout(function() { |
| 667 GCController.collect(); |
| 668 setTimeout(function() { |
| 669 GCController.collect(); |
| 670 setTimeout(callback, 0); |
| 671 }, 0); |
| 672 }, 0); |
| 673 }, 0); |
| 674 } |
| 675 |
| 652 function gc() { | 676 function gc() { |
| 653 if (typeof GCController !== "undefined") | 677 if (typeof GCController !== "undefined") |
| 654 GCController.collectAll(); | 678 GCController.collectAll(); |
| 655 else { | 679 else { |
| 656 var gcRec = function (n) { | 680 var gcRec = function (n) { |
| 657 if (n < 1) | 681 if (n < 1) |
| 658 return {}; | 682 return {}; |
| 659 var temp = {i: "ab" + i + (i / 100000)}; | 683 var temp = {i: "ab" + i + (i / 100000)}; |
| 660 temp += "foo"; | 684 temp += "foo"; |
| 661 gcRec(n-1); | 685 gcRec(n-1); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 testPassed = function(msg) { | 789 testPassed = function(msg) { |
| 766 workerPort.postMessage('PASS:' + msg); | 790 workerPort.postMessage('PASS:' + msg); |
| 767 }; | 791 }; |
| 768 finishJSTest = function() { | 792 finishJSTest = function() { |
| 769 workerPort.postMessage('DONE:'); | 793 workerPort.postMessage('DONE:'); |
| 770 }; | 794 }; |
| 771 debug = function(msg) { | 795 debug = function(msg) { |
| 772 workerPort.postMessage(msg); | 796 workerPort.postMessage(msg); |
| 773 }; | 797 }; |
| 774 } | 798 } |
| OLD | NEW |