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

Unified Diff: sky/tests/mutation-observer/document-fragment-insertion.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, 2 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 side-by-side diff with in-line comments
Download patch
Index: sky/tests/mutation-observer/document-fragment-insertion.html
diff --git a/sky/tests/mutation-observer/document-fragment-insertion.html b/sky/tests/mutation-observer/document-fragment-insertion.html
deleted file mode 100644
index d446c0083b865eb439a6075e68d65338e485e091..0000000000000000000000000000000000000000
--- a/sky/tests/mutation-observer/document-fragment-insertion.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<html>
-<link rel="import" href="../resources/mocha.html" />
-<link rel="import" href="../resources/chai.html" />
-<script>
-describe('DocumentFragments should remove all children of the fragment before moving children, ', function() {
- var mutations;
- var observer;
-
- beforeEach(function() {
- mutations = null;
- observer = new MutationObserver(function(records) {
- mutations = records;
- });
- });
-
- function createObservedFragment() {
- var fragment = document.createDocumentFragment();
- fragment.appendChild(document.createElement('b'));
- fragment.appendChild(document.createElement('i'));
- observer.observe(fragment, {childList: true});
- return fragment;
- }
-
- it('using appendChild', function(done) {
- var div = document.createElement('div');
- observer.observe(div, {childList: true});
- div.appendChild(createObservedFragment());
- setTimeout(function() {
- assert.equal(mutations.length, 2);
- assert.equal(mutations[0].addedNodes.length, 0);
- assert.equal(mutations[0].removedNodes.length, 2);
- assert.equal(mutations[1].addedNodes.length, 2);
- assert.equal(mutations[1].removedNodes.length, 0);
- done();
- }, 0);
- });
-
- it('using insertBefore', function(done) {
- var div = document.createElement('div');
- div.appendChild(document.createElement('span'));
- observer.observe(div, {childList: true});
- div.insertBefore(createObservedFragment(), div.firstChild);
- setTimeout(function() {
- assert.equal(mutations.length, 2);
- assert.equal(mutations[0].addedNodes.length, 0);
- assert.equal(mutations[0].removedNodes.length, 2);
- assert.equal(mutations[1].addedNodes.length, 2);
- assert.equal(mutations[1].removedNodes.length, 0);
- done();
- }, 0);
- });
-
- it('using replaceChild', function(done) {
- var div = document.createElement('div');
- div.appendChild(document.createElement('span'));
- observer.observe(div, {childList: true});
- div.replaceChild(createObservedFragment(), div.firstChild);
- setTimeout(function() {
- assert.equal(mutations.length, 2);
- assert.equal(mutations[0].addedNodes.length, 0);
- assert.equal(mutations[0].removedNodes.length, 2);
- assert.equal(mutations[1].addedNodes.length, 2);
- assert.equal(mutations[1].removedNodes.length, 1);
- done();
- }, 0);
- });
-});
-</script>
-</html>
« no previous file with comments | « sky/tests/mutation-observer/disconnect-cancel-pending.sky ('k') | sky/tests/mutation-observer/document-fragment-insertion.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698