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

Unified Diff: polymer_0.5.0/bower_components/web-animations-js/test/js/apply-preserving-inline-style.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/apply-preserving-inline-style.js
diff --git a/polymer_0.5.0/bower_components/web-animations-js/test/js/apply-preserving-inline-style.js b/polymer_0.5.0/bower_components/web-animations-js/test/js/apply-preserving-inline-style.js
new file mode 100644
index 0000000000000000000000000000000000000000..0416e74c5af3f9a56ae8e5ec9cd63fd7ae3a995e
--- /dev/null
+++ b/polymer_0.5.0/bower_components/web-animations-js/test/js/apply-preserving-inline-style.js
@@ -0,0 +1,72 @@
+suite('apply-preserving-inline-style', function() {
+ setup(function() {
+ this.element = document.createElement('div');
+ ensureStyleIsPatched(this.element);
+ this.style = this.element.style;
+ document.documentElement.appendChild(this.element);
+ });
+ teardown(function() {
+ this.element.remove();
+ });
+
+ test('Style is patched', function() {
+ assert(this.element._webAnimationsPatchedStyle);
+ });
+ test('Setting animated style', function() {
+ this.style.left = '0px';
+ this.element.style._set('left', '100px');
+ assert.equal(this.style.left, '0px');
+ });
+ test('Clearing animated style', function() {
+ this.style.left = '0px';
+ this.element.style._set('left', '100px');
+ this.element.style._clear('left');
+ assert.equal(this.style.left, '0px');
+ });
+ test('Patched length', function() {
+ this.element.style._set('left', '100px');
+ this.style.cssText = 'left: 0px; background-color: green;';
+ assert.equal(this.style.cssText, 'left: 0px; background-color: green;');
+ assert.equal(this.style.left, '0px');
+ assert.equal(this.style.backgroundColor, 'green');
+ assert.equal(this.style.length, 2);
+ });
+ test('Patched property getters and setters', function() {
+ this.style._set('left', '100px');
+ this.style.left = '0px';
+ this.style.backgroundColor = 'rgb(1, 2, 3)';
+ assert.equal(this.style.left, '0px');
+ assert.equal(this.style.backgroundColor, 'rgb(1, 2, 3)');
+ assert.equal(getComputedStyle(this.element).left, '100px');
+ assert.equal(getComputedStyle(this.element).backgroundColor, 'rgb(1, 2, 3)');
+ });
+ test('Patched setProperty/getPropertyValue', function() {
+ this.style._set('left', '100px');
+ this.style.setProperty('left', '0px');
+ this.style.setProperty('background-color', 'rgb(1, 2, 3)');
+ assert.equal(this.style.getPropertyValue('left'), '0px');
+ assert.equal(this.style.getPropertyValue('background-color'), 'rgb(1, 2, 3)');
+ assert.equal(getComputedStyle(this.element).left, '100px');
+ assert.equal(getComputedStyle(this.element).backgroundColor, 'rgb(1, 2, 3)');
+ });
+ test('Patched item()', function() {
+ this.style._set('left', '100px');
+ this.style.setProperty('left', '0px');
+ this.style.setProperty('background-color', 'rgb(1, 2, 3)');
+ assert.equal(this.style.item(0), 'left');
+ assert.equal(this.style.item(1), 'background-color');
+ assert.equal(this.style.item(2), '');
+ this.style.cssText = 'top: 0px';
+ assert.equal(this.style.item(0), 'top');
+ assert.equal(this.style.item(1), '');
+ });
+ test('Patched cssText', function() {
+ this.style._set('left', '100px');
+ assert.equal(this.style.length, 0);
+ this.style.setProperty('left', '0px');
+ this.style.setProperty('background-color', 'rgb(1, 2, 3)');
+ assert.equal(this.style.length, 2);
+ this.style.cssText = 'top: 0px';
+ assert.equal(this.style.length, 1);
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698