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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/CharacterData-appendChild.html

Issue 1988983002: Move the dom directory from web-platform-tests/ to wpt/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Node.appendChild applied to CharacterData</title>
4 <link rel=help href="https://dom.spec.whatwg.org/#dom-node-appendchild">
5 <link rel=help href="https://dom.spec.whatwg.org/#introduction-to-the-dom">
6 <script src="../../../../resources/testharness.js"></script>
7 <script src="../../../../resources/testharnessreport.js"></script>
8 <div id="log"></div>
9 <script>
10 function create(type) {
11 switch (type) {
12 case "Text": return document.createTextNode("test"); break;
13 case "Comment": return document.createComment("test"); break;
14 case "ProcessingInstruction": return document.createProcessingInstruction("t arget", "test"); break;
15 }
16 }
17
18 function testNode(type1, type2) {
19 test(function() {
20 var node1 = create(type1);
21 var node2 = create(type2);
22 assert_throws("HierarchyRequestError", function () {
23 node1.appendChild(node2);
24 }, "CharacterData type " + type1 + " must not have children");
25 }, type1 + ".appendChild(" + type2 + ")");
26 }
27
28 var types = ["Text", "Comment", "ProcessingInstruction"];
29 types.forEach(function(type1) {
30 types.forEach(function(type2) {
31 testNode(type1, type2);
32 });
33 });
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698