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

Side by Side Diff: sky/tests/mutation-observer/cross-document.sky

Issue 920343002: Delete Sky tests that we're not going to run with Dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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 <import src="../resources/chai.sky" />
3 <import src="../resources/mocha.sky" />
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 = new Document();
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 = new Document();
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

Powered by Google App Engine
This is Rietveld 408576698