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

Side by Side Diff: LayoutTests/web-animations-api/w3c/resources/keyframes-test.js

Issue 252113002: Web Animations API: Add simple keyframe tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Renames Created 6 years, 7 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
(Empty)
1 (function(){
2 'use strict'
3
4 function createElement() {
5 var element = document.createElement('div');
6 document.documentElement.appendChild(element);
7 return element;
8 }
9
10 function heldTiming(iterationStart) {
11 return {
12 duration: 1000,
13 playbackRate: 0,
14 fill: 'forwards',
15 iterationStart: iterationStart,
16 };
17 }
18
19 function assertAnimationStyles(keyframes, expectations) {
20 for (var progress in expectations) {
21 var element = createElement();
22 element.animate(keyframes, heldTiming(progress));
23 var computedStyle = getComputedStyle(element);
24 for (var property in expectations[progress]) {
25 assert_equals(computedStyle[property], expectations[progress][property],
26 property + ' at ' + (progress * 100) + '%');
27 }
28 }
29 }
30
31 window.assertAnimationStyles = assertAnimationStyles;
32 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698