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

Side by Side Diff: sky/tests/mutation-observer/delivery-order.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 describe('MutationObserver', function() {
6 it('should deliver in order of creation', function(done) {
7 var order = [];
8 var observers = [];
9
10 function setUpOrdering(num) {
11 observers.push(new MutationObserver(function(mutations) {
12 order.push(num);
13 }));
14 }
15
16 for (var i = 0; i < 10; ++i)
17 setUpOrdering(i);
18
19 var div = document.createElement('div');
20 observers[3].observe(div, {attributes: true});
21 observers[2].observe(div, {characterData: true, subtree: true});
22 observers[1].observe(div, {attributes: true});
23 observers[7].observe(div, {childList: true});
24 observers[4].observe(div, {attributes: true});
25 observers[9].observe(div, {attributes: true});
26 observers[0].observe(div, {childList: true});
27 observers[5].observe(div, {attributes: true});
28 observers[6].observe(div, {characterData: true, subtree: true});
29 observers[8].observe(div, {attributes: true});
30 div.setAttribute('foo', 'bar');
31 div.appendChild(document.createTextNode('hello'));
32 div.firstChild.textContent = 'goodbye';
33 setTimeout(function() {
34 assert.deepEqual(order, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
35 done();
36 }, 0);
37 });
38 });
39 </script>
40 </html>
OLDNEW
« no previous file with comments | « sky/tests/mutation-observer/cross-document.sky ('k') | sky/tests/mutation-observer/delivery-order.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698