OLD | NEW |
1 function test_create(method, iface, nodeType, nodeName) { | 1 function test_create(method, iface, nodeType, nodeName) { |
2 ["\u000b", "a -- b", "a-", "-b", null, undefined].forEach(function(value) { | 2 ["\u000b", "a -- b", "a-", "-b", null, undefined].forEach(function(value) { |
3 test(function() { | 3 test(function() { |
4 var c = document[method](value); | 4 var c = document[method](value); |
5 var expected = String(value); | 5 var expected = String(value); |
6 assert_true(c instanceof iface); | 6 assert_true(c instanceof iface); |
7 assert_true(c instanceof CharacterData); | 7 assert_true(c instanceof CharacterData); |
8 assert_true(c instanceof Node); | 8 assert_true(c instanceof Node); |
9 assert_equals(c.ownerDocument, document); | 9 assert_equals(c.ownerDocument, document); |
10 assert_equals(c.data, expected, "data"); | 10 assert_equals(c.data, expected, "data"); |
11 assert_equals(c.nodeValue, expected, "nodeValue"); | 11 assert_equals(c.nodeValue, expected, "nodeValue"); |
12 assert_equals(c.textContent, expected, "textContent"); | 12 assert_equals(c.textContent, expected, "textContent"); |
13 assert_equals(c.length, expected.length); | 13 assert_equals(c.length, expected.length); |
14 assert_equals(c.nodeType, nodeType); | 14 assert_equals(c.nodeType, nodeType); |
15 assert_equals(c.nodeName, nodeName); | 15 assert_equals(c.nodeName, nodeName); |
16 assert_equals(c.hasChildNodes(), false); | 16 assert_equals(c.hasChildNodes(), false); |
17 assert_equals(c.childNodes.length, 0); | 17 assert_equals(c.childNodes.length, 0); |
18 assert_equals(c.firstChild, null); | 18 assert_equals(c.firstChild, null); |
19 assert_equals(c.lastChild, null); | 19 assert_equals(c.lastChild, null); |
20 }, method + "(" + format_value(value) + ")"); | 20 }, method + "(" + format_value(value) + ")"); |
21 }); | 21 }); |
22 } | 22 } |
OLD | NEW |