4 <p>This is an integration test for childNodes. You should see
1 through
5 below.
</p>
6 <div id=
"console"></div>
7 <script src=
"../../../resources/js-test.js"></script>
10 if (window
.testRunner
)
11 testRunner
.dumpAsText();
13 var node
= document
.querySelector('pre');
15 for (var j
= 0; j
< 5; ++j
) {
16 var child
= document
.createElement('div');
17 child
.innerHTML
= j
+ 1;
18 node
.appendChild(child
);
19 for (var i
= node
.childNodes
.length
- 1; i
>= 0; --i
) {
20 var actual
= node
.childNodes
[i
] ? node
.childNodes
[i
].innerHTML
: undefined;
21 if (actual
!= i
+ 1) {
22 testFailed('Got ' + actual
+ ' on ' + (i
+ 1) + 'st/nd/th child after adding ' + (j
+ 1) + 'st/nd/th child.');
28 shouldBe("node.innerText", "'1\\n2\\n3\\n4\\n5\\n'");