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

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

Issue 1529523002: Import dom/ from web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak W3CImportExpectations Created 5 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
OLDNEW
(Empty)
1 function testRemove(node, parent, type) {
2 test(function() {
3 assert_true("remove" in node);
4 assert_equals(typeof node.remove, "function");
5 assert_equals(node.remove.length, 0);
6 }, type + " should support remove()");
7 test(function() {
8 assert_equals(node.parentNode, null, "Node should not have a parent");
9 assert_equals(node.remove(), undefined);
10 assert_equals(node.parentNode, null, "Removed new node should not have a par ent");
11 }, "remove() should work if " + type + " doesn't have a parent");
12 test(function() {
13 assert_equals(node.parentNode, null, "Node should not have a parent");
14 parent.appendChild(node);
15 assert_equals(node.parentNode, parent, "Appended node should have a parent") ;
16 assert_equals(node.remove(), undefined);
17 assert_equals(node.parentNode, null, "Removed node should not have a parent" );
18 assert_array_equals(parent.childNodes, [], "Parent should not have children" );
19 }, "remove() should work if " + type + " does have a parent");
20 test(function() {
21 assert_equals(node.parentNode, null, "Node should not have a parent");
22 var before = parent.appendChild(document.createComment("before"));
23 parent.appendChild(node);
24 var after = parent.appendChild(document.createComment("after"));
25 assert_equals(node.parentNode, parent, "Appended node should have a parent") ;
26 assert_equals(node.remove(), undefined);
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");
29 }, "remove() should work if " + type + " does have a parent and siblings");
30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698