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

Side by Side Diff: sky/tests/mutation-observer/cross-document.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 cross document moves', function() {
6 it('should handle basic observation', function(done) {
7 var mutations;
8 var div = document.createElement('div');
9 var observer = new MutationObserver(function(records) {
10 mutations = records;
11 });
12
13 observer.observe(div, {attributes: true});
14 var newDoc = document.implementation.createDocument('', '', null);
15 newDoc.appendChild(div);
16 div.id = 'foo';
17 setTimeout(function() {
18 assert.equal(mutations.length, 1);
19 assert.equal(mutations[0].type, 'attributes');
20 assert.equal(mutations[0].target, div);
21 assert.equal(mutations[0].attributeName, 'id');
22 observer.disconnect();
23 done();
24 }, 0);
25 });
26 it('should handle subtree observation', function(done) {
27 var mutations;
28 var div = document.createElement('div');
29 var subDiv = div.appendChild(document.createElement('div'));
30 var observer = new MutationObserver(function(records) {
31 mutations = records;
32 });
33
34 observer.observe(div, {attributes: true, subtree: true});
35 var newDoc = document.implementation.createDocument();
36 newDoc.appendChild(div);
37 subDiv.id = 'foo';
38 setTimeout(function() {
39 assert.equal(mutations.length, 1);
40 assert.equal(mutations[0].type, 'attributes');
41 assert.equal(mutations[0].target, subDiv);
42 assert.equal(mutations[0].attributeName, 'id');
43 observer.disconnect();
44 done();
45 }, 0);
46 });
47 });
48 </script>
49 </html>
OLDNEW
« no previous file with comments | « sky/tests/mutation-observer/create-during-delivery.sky ('k') | sky/tests/mutation-observer/cross-document.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698