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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/dom/nodes/ChildNode-remove.js

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
1 function testRemove(node, parent, type) { 1 function testRemove(node, parent, type) {
2 test(function() { 2 test(function() {
3 assert_true("remove" in node); 3 assert_true("remove" in node);
4 assert_equals(typeof node.remove, "function"); 4 assert_equals(typeof node.remove, "function");
5 assert_equals(node.remove.length, 0); 5 assert_equals(node.remove.length, 0);
6 }, type + " should support remove()"); 6 }, type + " should support remove()");
7 test(function() { 7 test(function() {
8 assert_equals(node.parentNode, null, "Node should not have a parent"); 8 assert_equals(node.parentNode, null, "Node should not have a parent");
9 assert_equals(node.remove(), undefined); 9 assert_equals(node.remove(), undefined);
10 assert_equals(node.parentNode, null, "Removed new node should not have a par ent"); 10 assert_equals(node.parentNode, null, "Removed new node should not have a par ent");
(...skipping 10 matching lines...) Expand all
21 assert_equals(node.parentNode, null, "Node should not have a parent"); 21 assert_equals(node.parentNode, null, "Node should not have a parent");
22 var before = parent.appendChild(document.createComment("before")); 22 var before = parent.appendChild(document.createComment("before"));
23 parent.appendChild(node); 23 parent.appendChild(node);
24 var after = parent.appendChild(document.createComment("after")); 24 var after = parent.appendChild(document.createComment("after"));
25 assert_equals(node.parentNode, parent, "Appended node should have a parent") ; 25 assert_equals(node.parentNode, parent, "Appended node should have a parent") ;
26 assert_equals(node.remove(), undefined); 26 assert_equals(node.remove(), undefined);
27 assert_equals(node.parentNode, null, "Removed node should not have a parent" ); 27 assert_equals(node.parentNode, null, "Removed node should not have a parent" );
28 assert_array_equals(parent.childNodes, [before, after], "Parent should have two children left"); 28 assert_array_equals(parent.childNodes, [before, after], "Parent should have two children left");
29 }, "remove() should work if " + type + " does have a parent and siblings"); 29 }, "remove() should work if " + type + " does have a parent and siblings");
30 } 30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698