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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 function isMinusZero(n) | 154 function isMinusZero(n) |
155 { | 155 { |
156 // the only way to tell 0 from -0 in JS is the fact that 1/-0 is | 156 // the only way to tell 0 from -0 in JS is the fact that 1/-0 is |
157 // -Infinity instead of Infinity | 157 // -Infinity instead of Infinity |
158 return n === 0 && 1/n < 0; | 158 return n === 0 && 1/n < 0; |
159 } | 159 } |
160 | 160 |
161 function isNewSVGTearOffType(v) | 161 function isNewSVGTearOffType(v) |
162 { | 162 { |
163 return ['[object SVGLength]', '[object SVGLengthList]'].indexOf(""+v) != -1; | 163 return ['[object SVGLength]', '[object SVGLengthList]', '[object SVGPoint]',
'[object SVGPointList]'].indexOf(""+v) != -1; |
164 } | 164 } |
165 | 165 |
166 function isResultCorrect(actual, expected) | 166 function isResultCorrect(actual, expected) |
167 { | 167 { |
168 if (expected === 0) | 168 if (expected === 0) |
169 return actual === expected && (1/actual) === (1/expected); | 169 return actual === expected && (1/actual) === (1/expected); |
170 if (actual === expected) | 170 if (actual === expected) |
171 return true; | 171 return true; |
172 // http://crbug.com/308818 : The new implementation of SVGListProperties do
not necessary return the same wrapper object, so === operator would not work. We
compare for their string representation instead. | 172 // http://crbug.com/308818 : The new implementation of SVGListProperties do
not necessary return the same wrapper object, so === operator would not work. We
compare for their string representation instead. |
173 if (isNewSVGTearOffType(expected) && typeof(expected) == typeof(actual) && a
ctual.valueAsString == expected.valueAsString) | 173 if (isNewSVGTearOffType(expected) && typeof(expected) == typeof(actual) && a
ctual.valueAsString == expected.valueAsString) |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 testPassed = function(msg) { | 765 testPassed = function(msg) { |
766 workerPort.postMessage('PASS:' + msg); | 766 workerPort.postMessage('PASS:' + msg); |
767 }; | 767 }; |
768 finishJSTest = function() { | 768 finishJSTest = function() { |
769 workerPort.postMessage('DONE:'); | 769 workerPort.postMessage('DONE:'); |
770 }; | 770 }; |
771 debug = function(msg) { | 771 debug = function(msg) { |
772 workerPort.postMessage(msg); | 772 workerPort.postMessage(msg); |
773 }; | 773 }; |
774 } | 774 } |
OLD | NEW |