Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit 448959f

Browse files
author
Scott J. Miles
committed
Remove bogus Platform.flush() calls
1 parent dee245c commit 448959f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

test/html/prop-attr-reflection.html

+14-8
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
xfoo.foo = 5;
8686
xfoo.setAttribute('def1', '15');
8787
xfoo.def2 = 15;
88-
Platform.flush();
88+
//
8989
assert.isFalse(xcompose.$.bar.hasAttribute('zim'), 'attribute bound to property updates when binding is made');
9090
assert.equal(xfoo.getAttribute('def2'), '15', 'default valued published property reflects to attr');
9191
assert.equal(xfoo.def1, '15', 'attr updates default valued published property');
@@ -94,7 +94,7 @@
9494
assert.equal(xfoo.foo, xfoo.getAttribute('foo'), 'property reflects attribute');
9595
//
9696
xfoo.baz = 'Hello';
97-
Platform.flush();
97+
//
9898
assert.equal(xfoo.baz, xfoo.getAttribute('baz'), 'attribute reflects property');
9999
//
100100
var xbar = document.querySelector('x-bar');
@@ -104,45 +104,51 @@
104104
xbar.zim = true;
105105
xbar.str = 'str!';
106106
xbar.obj = {hello: 'world'};
107-
Platform.flush();
107+
//
108108
assert.equal(xbar.foo, xbar.getAttribute('foo'), 'inherited published property is reflected');
109109
assert.equal(String(xbar.zot), xbar.getAttribute('zot'), 'attribute reflects property as number');
110110
assert.equal(xbar.getAttribute('zim'), '', 'attribute reflects true valued boolean property as having attribute');
111111
assert.equal(xbar.str, xbar.getAttribute('str'), 'attribute reflects property as published string');
112112
assert.isFalse(xbar.hasAttribute('obj'), 'attribute does not reflect object property');
113+
//
113114
xbar.setAttribute('zim', 'false');
114115
xbar.setAttribute('foo', 'foo!!');
115116
xbar.setAttribute('zot', 54);
116117
xbar.setAttribute('str', 'str!!');
117118
xbar.setAttribute('obj', "{'hello': 'world'}");
119+
//
118120
assert.equal(xbar.foo, xbar.getAttribute('foo'), 'property reflects attribute as string');
119121
assert.equal(xbar.zot, 54, 'property reflects attribute as number');
120122
assert.equal(xbar.zim, false, 'property reflects attribute as boolean');
121123
assert.equal(xbar.str, 'str!!', 'property reflects attribute as published string');
122124
assert.deepEqual(xbar.obj, {hello: 'world'}, 'property reflects attribute as object');
125+
//
123126
xbar.zim = false;
124-
Platform.flush();
127+
//
125128
assert.isFalse(xbar.hasAttribute('zim'), 'attribute reflects false valued boolean property as NOT having attribute');
129+
//
126130
var objAttr = xbar.getAttribute('obj');
127131
oneMutation(xbar, {attributes: true}, function() {
128132
assert.equal(xbar.getAttribute('obj'), 'hi', 'reflect property based on current type');
129133
//assert.isFalse(xbar.hasAttribute('obj'), 'property with default type of object does not serialize');
130134
done();
131135
});
132-
136+
//
133137
var xzot = document.querySelector('x-zot');
134138
assert.equal(xzot.str, 'str2');
135139
xzot.str = 'hello';
136140
assert.equal(xzot.getAttribute('str'), xzot.str);
137-
141+
//
138142
assert.equal(xzot.zot, 2);
139143
xzot.zot = 5;
140144
assert.isFalse(xzot.hasAttribute('zot'), 'extendee reflect false not honored');
141-
145+
//
142146
xbar.obj = 'hi';
143-
Platform.flush();
144147
// trigger a mutation to watch
145148
xbar.setAttribute('dummy', 'dummy');
149+
//
150+
// don't let observe polyfill wait, flush asap
151+
Platform.flush();
146152
});
147153
</script>
148154
</body>

0 commit comments

Comments
 (0)