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 | 5 |
6 // svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump tex
t + pixel results | 6 // svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump tex
t + pixel results |
7 if (self.testRunner) { | 7 if (self.testRunner) { |
8 if (self.enablePixelTesting) | 8 if (self.enablePixelTesting) |
9 testRunner.dumpAsTextWithPixelResults(); | 9 testRunner.dumpAsTextWithPixelResults(); |
10 else | 10 else |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 function stringify(v) | 193 function stringify(v) |
194 { | 194 { |
195 if (isNewSVGTearOffType(v)) | 195 if (isNewSVGTearOffType(v)) |
196 return v.valueAsString; | 196 return v.valueAsString; |
197 if (v === 0 && 1/v < 0) | 197 if (v === 0 && 1/v < 0) |
198 return "-0"; | 198 return "-0"; |
199 else return "" + v; | 199 else return "" + v; |
200 } | 200 } |
201 | 201 |
| 202 // Stringifies a DOM object. This function stringifies not only own properties |
| 203 // but also DOM attributes which are on a prototype chain. Note that |
| 204 // JSON.stringify only stringifies own properties. |
| 205 function stringifyDOMObject(domObject) |
| 206 { |
| 207 var object = {}; |
| 208 for (var property in domObject) { |
| 209 object[property] = domObject[property]; |
| 210 } |
| 211 return JSON.stringify(object); |
| 212 } |
| 213 |
202 function evalAndLog(_a, _quiet) | 214 function evalAndLog(_a, _quiet) |
203 { | 215 { |
204 if (typeof _a != "string") | 216 if (typeof _a != "string") |
205 debug("WARN: tryAndLog() expects a string argument"); | 217 debug("WARN: tryAndLog() expects a string argument"); |
206 | 218 |
207 // Log first in case things go horribly wrong or this causes a sync event. | 219 // Log first in case things go horribly wrong or this causes a sync event. |
208 if (!_quiet) | 220 if (!_quiet) |
209 debug(_a); | 221 debug(_a); |
210 | 222 |
211 var _av; | 223 var _av; |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 testPassed = function(msg) { | 856 testPassed = function(msg) { |
845 workerPort.postMessage('PASS:' + msg); | 857 workerPort.postMessage('PASS:' + msg); |
846 }; | 858 }; |
847 finishJSTest = function() { | 859 finishJSTest = function() { |
848 workerPort.postMessage('DONE:'); | 860 workerPort.postMessage('DONE:'); |
849 }; | 861 }; |
850 debug = function(msg) { | 862 debug = function(msg) { |
851 workerPort.postMessage(msg); | 863 workerPort.postMessage(msg); |
852 }; | 864 }; |
853 } | 865 } |
OLD | NEW |