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