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

Side by Side Diff: polymer_0.5.4/bower_components/web-animations-js/test/js/number-handler.js

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 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
OLDNEW
1 suite('number-handler', function() { 1 suite('number-handler', function() {
2 test('parse numbers', function() { 2 test('parse numbers', function() {
3 var tests = { 3 var tests = {
4 '0': 0, 4 '0': 0,
5 '1234': 1234, 5 '1234': 1234,
6 '-40': -40, 6 '-40': -40,
7 '+40': 40, 7 '+40': 40,
8 ' -40 ': -40, 8 ' -40 ': -40,
9 '4.0': 4, 9 '4.0': 4,
10 '0.4': 0.4, 10 '0.4': 0.4,
11 '.1234': 0.1234, 11 '.1234': 0.1234,
12 '12.34': 12.34, 12 '12.34': 12.34,
13 '+.1234': 0.1234, 13 '+.1234': 0.1234,
14 '+12.34': 12.34, 14 '+12.34': 12.34,
15 '-.1234': -0.1234, 15 '-.1234': -0.1234,
16 '-12.34': -12.34, 16 '-12.34': -12.34,
17 }; 17 };
18 for (var string in tests) { 18 for (var string in tests) {
19 assert.equal(webAnimationsMinifill.parseNumber(string), tests[string], 'Pa rsing "' + string + '"'); 19 assert.equal(webAnimations1.parseNumber(string), tests[string], 'Parsing " ' + string + '"');
20 } 20 }
21 }); 21 });
22 test('invalid numbers fail to parse', function() { 22 test('invalid numbers fail to parse', function() {
23 assert.isUndefined(webAnimationsMinifill.parseNumber('')); 23 assert.isUndefined(webAnimations1.parseNumber(''));
24 assert.isUndefined(webAnimationsMinifill.parseNumber('nine')); 24 assert.isUndefined(webAnimations1.parseNumber('nine'));
25 assert.isUndefined(webAnimationsMinifill.parseNumber('1 2')); 25 assert.isUndefined(webAnimations1.parseNumber('1 2'));
26 assert.isUndefined(webAnimationsMinifill.parseNumber('+-0')); 26 assert.isUndefined(webAnimations1.parseNumber('+-0'));
27 assert.isUndefined(webAnimationsMinifill.parseNumber('50px')); 27 assert.isUndefined(webAnimations1.parseNumber('50px'));
28 assert.isUndefined(webAnimationsMinifill.parseNumber('1.2.3')); 28 assert.isUndefined(webAnimations1.parseNumber('1.2.3'));
29 }); 29 });
30 test('opacity clamping', function() { 30 test('opacity clamping', function() {
31 var interpolation = webAnimationsMinifill.propertyInterpolation('opacity', ' 0', '1'); 31 var interpolation = webAnimations1.propertyInterpolation('opacity', '0', '1' );
32 assert.equal(interpolation(-1), '0'); 32 assert.equal(interpolation(-1), '0');
33 assert.equal(interpolation(2), '1'); 33 assert.equal(interpolation(2), '1');
34 }); 34 });
35 }); 35 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698