Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: LayoutTests/svg/animations/resources/SVGAnimationTestCase.js

Issue 172973002: Rewrite svg/dynamic-updates to use text-based repaint harness (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: actually add file Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/animations/repeatn-remove-add-animation.html ('k') | LayoutTests/svg/animations/resources/SVGTestCase.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698