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

Side by Side Diff: sky/tests/dom/appendChild.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/framework/sky-element/sky-element.sky ('k') | sky/tests/dom/replaceChild.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("appendChild", function() { 6 describe("appendChild", 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 assert.equal(child2.parentNode, parent); 46 assert.equal(child2.parentNode, parent);
47 assert.equal(child3.parentNode, parent); 47 assert.equal(child3.parentNode, parent);
48 assert.equal(child4.parentNode, parent); 48 assert.equal(child4.parentNode, parent);
49 assert.equal(childNodeCount(parent), 4); 49 assert.equal(childNodeCount(parent), 4);
50 assert.equal(childElementCount(parent), 2); 50 assert.equal(childElementCount(parent), 2);
51 }); 51 });
52 52
53 it("should throw when inserting a tree scope", function() { 53 it("should throw when inserting a tree scope", function() {
54 var parent = document.createElement("div"); 54 var parent = document.createElement("div");
55 var doc = new Document(); 55 var doc = new Document();
56 var shadowRoot = document.createElement("span").createShadowRoot(); 56 var shadowRoot = document.createElement("span").ensureShadowRoot();
57 assert.throws(function() { 57 assert.throws(function() {
58 parent.appendChild(doc); 58 parent.appendChild(doc);
59 }); 59 });
60 assert.throws(function() { 60 assert.throws(function() {
61 parent.appendChild(shadowRoot); 61 parent.appendChild(shadowRoot);
62 }); 62 });
63 assert.throws(function() { 63 assert.throws(function() {
64 doc.appendChild(fragment); 64 doc.appendChild(fragment);
65 }); 65 });
66 }); 66 });
67 67
68 it("should throw when appending to a text", function() { 68 it("should throw when appending to a text", function() {
69 var parent = new Text(); 69 var parent = new Text();
70 assert.throws(function() { 70 assert.throws(function() {
71 parent.appendChild(document.createElement("div")); 71 parent.appendChild(document.createElement("div"));
72 }); 72 });
73 }); 73 });
74 }); 74 });
75 </script> 75 </script>
76 </sky> 76 </sky>
OLDNEW
« no previous file with comments | « sky/framework/sky-element/sky-element.sky ('k') | sky/tests/dom/replaceChild.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698