Chromium Code Reviews| Index: LayoutTests/fast/dom/ParentNode/append.html |
| diff --git a/LayoutTests/fast/dom/ParentNode/append.html b/LayoutTests/fast/dom/ParentNode/append.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b965ee3ac49d54208cfed9f2259f2e3876516c45 |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/ParentNode/append.html |
| @@ -0,0 +1,60 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<script> |
| + |
| +function test_append(node, nodeName) { |
| + |
| + test(function() { |
| + var parent = node.cloneNode(); |
| + parent.append(); |
| + expected = ""; |
| + assert_equals(parent.innerHTML, expected); |
| + }, nodeName + '.append() without any argument, on a parent having no child.'); |
|
philipj_slow
2015/06/15 10:06:58
There are double spaces where and in some other pl
Paritosh Kumar
2015/06/23 13:32:08
Done.
|
| + |
| + test(function() { |
| + var parent = node.cloneNode(); |
| + parent.append(null); |
| + expected = 'null'; |
| + assert_equals(parent.innerHTML, expected); |
| + }, nodeName + '.append() with null as an argument, on a parent having no child.'); |
| + |
| + test(function() { |
| + var parent = node.cloneNode(); |
| + parent.append('text'); |
| + expected = 'text'; |
| + assert_equals(parent.innerHTML, expected); |
| + }, nodeName + '.append() with only text as an argument, on a parent having no child.'); |
| + |
| + test(function() { |
| + var parent = node.cloneNode(); |
| + var x = document.createElement('x'); |
| + parent.append(x); |
| + expected = '<x></x>'; |
| + assert_equals(parent.innerHTML, expected); |
| + }, nodeName + '.append() with only one element as an argument, on a parent having no child.'); |
| + |
| + test(function() { |
| + var parent = node.cloneNode(); |
| + var child = document.createElement('test'); |
| + parent.appendChild(child); |
| + parent.append(null); |
| + expected = '<test></test>null'; |
| + assert_equals(parent.innerHTML, expected); |
| + }, nodeName + '.append() with null as an argument, on a parent having a child.'); |
| + |
| + test(function() { |
| + var parent = node.cloneNode(); |
| + var x = document.createElement('x'); |
| + var child = document.createElement('test'); |
| + parent.appendChild(child); |
| + parent.append(x, 'text'); |
| + expected = '<test></test><x></x>text'; |
| + assert_equals(parent.innerHTML, expected); |
| + }, nodeName + '.append() with one element and text as argument, on a parent having a child.'); |
| +} |
| + |
| +test_append(document.createElement('div'), 'Element'); |
|
philipj_slow
2015/06/15 10:06:58
What about Document and DocumentFragment?
|
| + |
| +</script> |
| +</html> |