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

Side by Side 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, 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('apply-preserving-inline-style', function() {
2 setup(function() {
3 this.element = document.createElement('div');
4 ensureStyleIsPatched(this.element);
5 this.style = this.element.style;
6 document.documentElement.appendChild(this.element);
7 });
8 teardown(function() {
9 this.element.remove();
10 });
11
12 test('Style is patched', function() {
13 assert(this.element._webAnimationsPatchedStyle);
14 });
15 test('Setting animated style', function() {
16 this.style.left = '0px';
17 this.element.style._set('left', '100px');
18 assert.equal(this.style.left, '0px');
19 });
20 test('Clearing animated style', function() {
21 this.style.left = '0px';
22 this.element.style._set('left', '100px');
23 this.element.style._clear('left');
24 assert.equal(this.style.left, '0px');
25 });
26 test('Patched length', function() {
27 this.element.style._set('left', '100px');
28 this.style.cssText = 'left: 0px; background-color: green;';
29 assert.equal(this.style.cssText, 'left: 0px; background-color: green;');
30 assert.equal(this.style.left, '0px');
31 assert.equal(this.style.backgroundColor, 'green');
32 assert.equal(this.style.length, 2);
33 });
34 test('Patched property getters and setters', function() {
35 this.style._set('left', '100px');
36 this.style.left = '0px';
37 this.style.backgroundColor = 'rgb(1, 2, 3)';
38 assert.equal(this.style.left, '0px');
39 assert.equal(this.style.backgroundColor, 'rgb(1, 2, 3)');
40 assert.equal(getComputedStyle(this.element).left, '100px');
41 assert.equal(getComputedStyle(this.element).backgroundColor, 'rgb(1, 2, 3)') ;
42 });
43 test('Patched setProperty/getPropertyValue', function() {
44 this.style._set('left', '100px');
45 this.style.setProperty('left', '0px');
46 this.style.setProperty('background-color', 'rgb(1, 2, 3)');
47 assert.equal(this.style.getPropertyValue('left'), '0px');
48 assert.equal(this.style.getPropertyValue('background-color'), 'rgb(1, 2, 3)' );
49 assert.equal(getComputedStyle(this.element).left, '100px');
50 assert.equal(getComputedStyle(this.element).backgroundColor, 'rgb(1, 2, 3)') ;
51 });
52 test('Patched item()', function() {
53 this.style._set('left', '100px');
54 this.style.setProperty('left', '0px');
55 this.style.setProperty('background-color', 'rgb(1, 2, 3)');
56 assert.equal(this.style.item(0), 'left');
57 assert.equal(this.style.item(1), 'background-color');
58 assert.equal(this.style.item(2), '');
59 this.style.cssText = 'top: 0px';
60 assert.equal(this.style.item(0), 'top');
61 assert.equal(this.style.item(1), '');
62 });
63 test('Patched cssText', function() {
64 this.style._set('left', '100px');
65 assert.equal(this.style.length, 0);
66 this.style.setProperty('left', '0px');
67 this.style.setProperty('background-color', 'rgb(1, 2, 3)');
68 assert.equal(this.style.length, 2);
69 this.style.cssText = 'top: 0px';
70 assert.equal(this.style.length, 1);
71 });
72 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698