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

Side by Side Diff: sky/tests/mutation-observer/create-during-delivery.html

Issue 685623002: Move the tests from .html to .sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 <html>
2 <link rel="import" href="../resources/chai.html" />
3 <link rel="import" href="../resources/mocha.html" />
4 <script>
5 window.jsTestIsAsync = true;
6
7 describe('MutationObservers', function() {
8 it ('must wait for the next loop when created during delivery', function(don e) {
9 var order = [];
10 var div = document.createElement('div');
11
12 var observer3;
13 var observer1 = new MutationObserver(function(mutations) {
14 order.push(1);
15 if (!observer3) {
16 observer3 = new MutationObserver(function(mutations) {
17 order.push(3);
18 });
19 observer3.observe(div, {attributes: true});
20 div.setAttribute('foo', 'baz');
21 }
22 });
23 var observer2 = new MutationObserver(function(mutations) {
24 order.push(2);
25 });
26
27 observer1.observe(div, {attributes: true});
28 observer2.observe(div, {attributes: true});
29 div.setAttribute('foo', 'bar');
30 setTimeout(function() {
31 assert.deepEqual(order, [1, 2, 1, 3]);
32 done();
33 }, 0);
34 });
35 });
36 </script>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698