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

Side by Side Diff: polymer_0.5.0/bower_components/web-animations-js/test/js/property-interpolation.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 suite('property-interpolation', function() {
2 test('unmatched inputs return step interpolation', function() {
3 tests = [['unknown', 'input', 'tuple'],
4 ['unknown', '10px', '50px'],
5 ['width', '100px', 'auto'],
6 ['width', 'auto', '100px']];
7 for (var i = 0; i < tests.length; i++) {
8 var property = tests[i][0];
9 var left = tests[i][1];
10 var right = tests[i][2];
11 interpolation = webAnimationsMinifill.propertyInterpolation(property, left , right);
12 assert.equal(interpolation(-1), left);
13 assert.equal(interpolation(0), left);
14 assert.equal(interpolation(0.45), left);
15 assert.equal(interpolation(0.5), right);
16 assert.equal(interpolation(0.55), right);
17 assert.equal(interpolation(1), right);
18 assert.equal(interpolation(2), right);
19 }
20 });
21
22 test('registers camel cased property names', function() {
23 function merge(a, b) {
24 return [a, b, function(x) { return a + b; }];
25 };
26 webAnimationsMinifill.addPropertiesHandler(Number, merge, ['dummy-property'] );
27 assert.equal(webAnimationsMinifill.propertyInterpolation('dummy-property', 1 , 2)(0.5), 3);
28 assert.equal(webAnimationsMinifill.propertyInterpolation('dummyProperty', 5, 3)(0.5), 8);
29 });
30 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698