OLD | NEW |
1 // Inspired by Layoutests/animations/animation-test-helpers.js | 1 // Inspired by Layoutests/animations/animation-test-helpers.js |
2 // Modified to work with SVG and together with LayoutTests/svg/dynamic-updates/r
esources/SVGTestCase.js | |
3 | 2 |
4 function isCloseEnough(actual, desired, tolerance) { | 3 function isCloseEnough(actual, desired, tolerance) { |
5 var diff = Math.abs(actual - desired); | 4 var diff = Math.abs(actual - desired); |
6 return diff <= tolerance; | 5 return diff <= tolerance; |
7 } | 6 } |
8 | 7 |
9 function shouldBeCloseEnough(_a, _b, tolerance) { | 8 function shouldBeCloseEnough(_a, _b, tolerance) { |
10 if (typeof tolerance != "number") | 9 if (typeof tolerance != "number") |
11 tolerance = 0.1 // Default | 10 tolerance = 0.1 // Default |
12 if (typeof _a != "string" || typeof _b != "string") | 11 if (typeof _a != "string" || typeof _b != "string") |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 134 } |
136 | 135 |
137 // Pause animations, we'll drive them manually. | 136 // Pause animations, we'll drive them manually. |
138 rootSVGElement.pauseAnimations(); | 137 rootSVGElement.pauseAnimations(); |
139 | 138 |
140 if (window.testRunner) | 139 if (window.testRunner) |
141 setTimeout(sampleAnimation, 0); | 140 setTimeout(sampleAnimation, 0); |
142 else | 141 else |
143 setTimeout(sampleAnimation, 50); | 142 setTimeout(sampleAnimation, 50); |
144 } | 143 } |
OLD | NEW |