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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 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: third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html
index 5e3b2815d374b291d1c7586e9f658c89a531e7fd..663067eb9f8b3e56c1e837acb8a95114ad17405c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html
@@ -4,6 +4,43 @@
<script src="../../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/range-insertNode-separate-endContainer.js"></script>
+<script>
+description('Test for proper behavior of Range.insertNode(documentFragment) when startContainer != endContainer');
+
+var p = document.createElement('p');
+var t1 = document.createTextNode('12345');
+p.appendChild(t1);
+var t2 = document.createTextNode('ABCDE');
+p.appendChild(t2);
+document.body.appendChild(p);
+var r = document.createRange();
+r.setStart(p, 1);
+r.setEnd(t2, 3);
+shouldBeEqualToString("r.toString()", "ABC");
+
+var df = document.createDocumentFragment();
+var t3 = document.createTextNode("PQR");
+var t4 = document.createTextNode("XYZ");
+df.appendChild(t3);
+df.appendChild(t4);
+r.insertNode(df);
+
+shouldBe("p.childNodes.length", "4");
+shouldBe("p.childNodes[0]", "t1");
+shouldBe("p.childNodes[1]", "t3");
+shouldBe("p.childNodes[2]", "t4");
+shouldBe("p.childNodes[3]", "t2");
+
+shouldBeFalse("r.collapsed");
+shouldBe("r.commonAncestorContainer", "p");
+shouldBe("r.startContainer", "p");
+shouldBe("r.startOffset", "1");
+shouldBe("r.endContainer", "t2");
+shouldBe("r.endOffset", "3");
+shouldBeEqualToString("r.toString()", "PQRXYZABC")
+
+// clean up after ourselves
+document.body.removeChild(p);
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698