| OLD | NEW |
| 1 // js-test now supports lazily printing test results which dumps all test | 1 // js-test now supports lazily printing test results which dumps all test |
| 2 // results once at the end of the test instead of building them up. To enable | 2 // results once at the end of the test instead of building them up. To enable |
| 3 // this option, call setPrintTestResultsLazily() before running any tests. | 3 // this option, call setPrintTestResultsLazily() before running any tests. |
| 4 var _lazyTestResults; // Set by setPrintTestResultsLazily(). | 4 var _lazyTestResults; // Set by setPrintTestResultsLazily(). |
| 5 var _lazyDescription; // Set by description() after setPrintTestResultsLazily(). | 5 var _lazyDescription; // Set by description() after setPrintTestResultsLazily(). |
| 6 | 6 |
| 7 // svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump tex
t + pixel results | 7 // svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump tex
t + pixel results |
| 8 if (self.testRunner) { | 8 if (self.testRunner) { |
| 9 if (self.enablePixelTesting) | 9 if (self.enablePixelTesting) |
| 10 testRunner.dumpAsTextWithPixelResults(); | 10 testRunner.dumpAsTextWithPixelResults(); |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 testFailed("expectError() not called before shouldHaveHadError()"); | 758 testFailed("expectError() not called before shouldHaveHadError()"); |
| 759 } | 759 } |
| 760 | 760 |
| 761 // With Oilpan tests that rely on garbage collection need to go through | 761 // With Oilpan tests that rely on garbage collection need to go through |
| 762 // the event loop in order to get precise garbage collections. Oilpan | 762 // the event loop in order to get precise garbage collections. Oilpan |
| 763 // uses conservative stack scanning when not at the event loop and that | 763 // uses conservative stack scanning when not at the event loop and that |
| 764 // can artificially keep objects alive. Therefore, tests that need to check | 764 // can artificially keep objects alive. Therefore, tests that need to check |
| 765 // that something is dead need to use this asynchronous collectGarbage | 765 // that something is dead need to use this asynchronous collectGarbage |
| 766 // function. | 766 // function. |
| 767 function asyncGC(callback) { | 767 function asyncGC(callback) { |
| 768 var documentsBefore = window.internals.numberOfLiveDocuments(); |
| 768 GCController.collectAll(); | 769 GCController.collectAll(); |
| 769 // FIXME: we need a better way of waiting for chromium events to happen | 770 // FIXME: we need a better way of waiting for chromium events to happen |
| 770 setTimeout(callback, 0); | 771 setTimeout(function () { |
| 772 var documentsAfter = window.internals.numberOfLiveDocuments(); |
| 773 if (documentsAfter < documentsBefore) |
| 774 asyncGC(callback); |
| 775 else |
| 776 callback(); |
| 777 }, 0); |
| 771 } | 778 } |
| 772 | 779 |
| 773 function gc() { | 780 function gc() { |
| 774 if (typeof GCController !== "undefined") | 781 if (typeof GCController !== "undefined") |
| 775 GCController.collectAll(); | 782 GCController.collectAll(); |
| 776 else { | 783 else { |
| 777 var gcRec = function (n) { | 784 var gcRec = function (n) { |
| 778 if (n < 1) | 785 if (n < 1) |
| 779 return {}; | 786 return {}; |
| 780 var temp = {i: "ab" + i + (i / 100000)}; | 787 var temp = {i: "ab" + i + (i / 100000)}; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 testPassed = function(msg) { | 920 testPassed = function(msg) { |
| 914 workerPort.postMessage('PASS:' + msg); | 921 workerPort.postMessage('PASS:' + msg); |
| 915 }; | 922 }; |
| 916 finishJSTest = function() { | 923 finishJSTest = function() { |
| 917 workerPort.postMessage('DONE:'); | 924 workerPort.postMessage('DONE:'); |
| 918 }; | 925 }; |
| 919 debug = function(msg) { | 926 debug = function(msg) { |
| 920 workerPort.postMessage(msg); | 927 workerPort.postMessage(msg); |
| 921 }; | 928 }; |
| 922 } | 929 } |
| OLD | NEW |