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

Side by Side Diff: polymer_0.5.0/bower_components/web-animations-js/test/blink/resources/keyframes-test.js

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
(Empty)
1 (function(){
2 'use strict'
3
4 function createElement() {
5 var element = document.createElement('div');
6 element.style.position = 'absolute';
7 document.documentElement.appendChild(element);
8 return element;
9 }
10
11 function heldTiming(progress) {
12 return {
13 duration: 1000,
14 fill: 'forwards',
15 delay: -progress * 1000,
16 };
17 }
18
19 function assertAnimationStyles(keyframes, expectations, description) {
20 for (var progress in expectations) {
21 var element = createElement();
22 element.animate(keyframes, heldTiming(progress));
23
24 var computedStyle = getComputedStyle(element);
25 for (var property in expectations[progress]) {
26 assert_equals(computedStyle[property], expectations[progress][property],
27 property + ' at ' + (progress * 100) + '%' + (description ? ' ' + desc ription : ''));
28 }
29 }
30 }
31
32 window.assertAnimationStyles = assertAnimationStyles;
33 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698