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

Side by Side Diff: sky/tests/mutation-observer/disconnect-cancel-pending.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.disconnect', function() {
6 it('should cancel pending delivery', function(done) {
7 var mutations;
8 var observer;
9 var div;
10
11 function start() {
12 mutations = null;
13 div = document.createElement('div');
14
15 observer = new MutationObserver(function(m) {
16 mutations = m;
17 });
18
19 observer.observe(div, { attributes: true });
20 div.setAttribute('foo', 'bar');
21 observer.disconnect();
22 setTimeout(next, 0);
23 }
24
25 function next() {
26 // Disconnecting should cancel any pending delivery...
27 assert.equal(mutations, null);
28 observer.observe(div, { attributes: true });
29 div.setAttribute('bar', 'baz');
30 setTimeout(finish, 0);
31 }
32
33 function finish() {
34 // ...and re-observing should not see any of the previously-generate d records.
35 assert.equal(mutations.length, 1);
36 assert.equal(mutations[0].attributeName, "bar");
37 done();
38 }
39
40 start();
41 });
42 });
43 </script>
44 </html>
OLDNEW
« no previous file with comments | « sky/tests/mutation-observer/delivery-order.sky ('k') | sky/tests/mutation-observer/disconnect-cancel-pending.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698