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

Side by Side Diff: sky/tests/dom/replaceChild.sky

Issue 759663003: Only allow one shadowRoot. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: ojan review. Created 6 years 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
« no previous file with comments | « sky/tests/dom/appendChild.sky ('k') | sky/tests/mutation-observer/shadow-dom.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <sky> 1 <sky>
2 <import src="../resources/chai.sky" /> 2 <import src="../resources/chai.sky" />
3 <import src="../resources/mocha.sky" /> 3 <import src="../resources/mocha.sky" />
4 <import src="../resources/dom-utils.sky" as="DomUtils" /> 4 <import src="../resources/dom-utils.sky" as="DomUtils" />
5 <script> 5 <script>
6 describe("replaceChild", function() { 6 describe("replaceChild", function() {
7 var childElementCount = DomUtils.childElementCount; 7 var childElementCount = DomUtils.childElementCount;
8 var childNodeCount = DomUtils.childNodeCount; 8 var childNodeCount = DomUtils.childNodeCount;
9 9
10 it("should throw with invalid arguments", function() { 10 it("should throw with invalid arguments", function() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 assert.equal(child4.parentNode, parent); 60 assert.equal(child4.parentNode, parent);
61 assert.isNull(oldChild.parentNode); 61 assert.isNull(oldChild.parentNode);
62 assert.equal(childNodeCount(parent), 5); 62 assert.equal(childNodeCount(parent), 5);
63 assert.equal(childElementCount(parent), 3); 63 assert.equal(childElementCount(parent), 3);
64 assert.equal(parent.lastChild, lastChild); 64 assert.equal(parent.lastChild, lastChild);
65 }); 65 });
66 66
67 it("should throw when inserting a tree scope", function() { 67 it("should throw when inserting a tree scope", function() {
68 var parent = document.createElement("div"); 68 var parent = document.createElement("div");
69 var doc = new Document(); 69 var doc = new Document();
70 var shadowRoot = document.createElement("span").createShadowRoot(); 70 var shadowRoot = document.createElement("span").ensureShadowRoot();
71 assert.throws(function() { 71 assert.throws(function() {
72 parent.replaceChild(doc); 72 parent.replaceChild(doc);
73 }); 73 });
74 assert.throws(function() { 74 assert.throws(function() {
75 parent.replaceChild(shadowRoot); 75 parent.replaceChild(shadowRoot);
76 }); 76 });
77 assert.throws(function() { 77 assert.throws(function() {
78 doc.replaceChild(fragment); 78 doc.replaceChild(fragment);
79 }); 79 });
80 }); 80 });
81 81
82 it("should throw when appending to a text", function() { 82 it("should throw when appending to a text", function() {
83 var parent = new Text(); 83 var parent = new Text();
84 assert.throws(function() { 84 assert.throws(function() {
85 parent.replaceChild(document.createElement("div"), null); 85 parent.replaceChild(document.createElement("div"), null);
86 }); 86 });
87 }); 87 });
88 }); 88 });
89 </script> 89 </script>
90 </sky> 90 </sky>
OLDNEW
« no previous file with comments | « sky/tests/dom/appendChild.sky ('k') | sky/tests/mutation-observer/shadow-dom.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698