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..b28ded996e897a06212e52b9a2051ffe9ad373ed |
--- /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() with empty argument, on a parent having no child.'); |
+ |
+ 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'); |
+ |
+</script> |
+</html> |