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

Unified 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, 12 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 side-by-side diff with in-line comments
Download patch
Index: polymer_0.5.0/bower_components/web-animations-js/test/js/property-interpolation.js
diff --git a/polymer_0.5.0/bower_components/web-animations-js/test/js/property-interpolation.js b/polymer_0.5.0/bower_components/web-animations-js/test/js/property-interpolation.js
new file mode 100644
index 0000000000000000000000000000000000000000..47fafb02d9240fd5fb849150562b02e054f7a43b
--- /dev/null
+++ b/polymer_0.5.0/bower_components/web-animations-js/test/js/property-interpolation.js
@@ -0,0 +1,30 @@
+suite('property-interpolation', function() {
+ test('unmatched inputs return step interpolation', function() {
+ tests = [['unknown', 'input', 'tuple'],
+ ['unknown', '10px', '50px'],
+ ['width', '100px', 'auto'],
+ ['width', 'auto', '100px']];
+ for (var i = 0; i < tests.length; i++) {
+ var property = tests[i][0];
+ var left = tests[i][1];
+ var right = tests[i][2];
+ interpolation = webAnimationsMinifill.propertyInterpolation(property, left, right);
+ assert.equal(interpolation(-1), left);
+ assert.equal(interpolation(0), left);
+ assert.equal(interpolation(0.45), left);
+ assert.equal(interpolation(0.5), right);
+ assert.equal(interpolation(0.55), right);
+ assert.equal(interpolation(1), right);
+ assert.equal(interpolation(2), right);
+ }
+ });
+
+ test('registers camel cased property names', function() {
+ function merge(a, b) {
+ return [a, b, function(x) { return a + b; }];
+ };
+ webAnimationsMinifill.addPropertiesHandler(Number, merge, ['dummy-property']);
+ assert.equal(webAnimationsMinifill.propertyInterpolation('dummy-property', 1, 2)(0.5), 3);
+ assert.equal(webAnimationsMinifill.propertyInterpolation('dummyProperty', 5, 3)(0.5), 8);
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698