| OLD | NEW |
| 1 // test 70: XML encoding test | 1 // test 70: XML encoding test |
| 2 // q.v. XML 1.0, section 4.3.3 Character Encoding in Entities | 2 // q.v. XML 1.0, section 4.3.3 Character Encoding in Entities |
| 3 // this only tests one of a large number of conditions that should cause fatal e
rrors | 3 // this only tests one of a large number of conditions that should cause fatal e
rrors |
| 4 | 4 |
| 5 function runEncodingTest(event) | 5 function runEncodingTest(event) |
| 6 { | 6 { |
| 7 debug("Testing: " + encodingTests[currentTest-1]); | 7 debug("Testing: " + encodingTests[currentTest-1]); |
| 8 shouldBeEqualToString("iframe.contentDocument.documentElement.tagName", "roo
t"); | 8 shouldBeEqualToString("iframe.contentDocument.documentElement.tagName", "roo
t"); |
| 9 shouldBeTrue("iframe.contentDocument.documentElement.getElementsByTagName('t
est').length < 1"); | 9 shouldBeTrue("iframe.contentDocument.documentElement.getElementsByTagName('t
est').length < 1"); |
| 10 setTimeout(runNextTest, 0); | 10 setTimeout(runNextTest, 0); |
| 11 } | 11 } |
| 12 | 12 |
| 13 var currentTest = 0; | 13 var currentTest = 0; |
| 14 var encodingTests = [ | 14 var encodingTests = [ |
| 15 "invalid-xml-utf8.xml", | 15 "invalid-xml-utf8.xml", |
| 16 "invalid-xml-utf16.xml", | 16 "invalid-xml-utf16.xml", |
| 17 "invalid-xml-shift-jis.xml", | 17 "invalid-xml-shift-jis.xml", |
| 18 "invalid-xml-x-mac-thai.xml", | 18 "invalid-xml-x-mac-thai.xml", |
| 19 ]; | 19 ]; |
| 20 | 20 |
| 21 function runNextTest() | 21 function runNextTest() |
| 22 { | 22 { |
| 23 if (currentTest >= encodingTests.length) { | 23 if (currentTest >= encodingTests.length) { |
| 24 var script = document.createElement("script"); | |
| 25 script.src = "../js/resources/js-test-post.js"; | |
| 26 if (window.testRunner) | |
| 27 script.setAttribute("onload", "testRunner.notifyDone()"); | |
| 28 document.body.appendChild(script); | |
| 29 iframe.parentNode.removeChild(iframe); | 24 iframe.parentNode.removeChild(iframe); |
| 25 finishJSTest(); |
| 30 return; | 26 return; |
| 31 } | 27 } |
| 32 iframe.src = "resources/" + encodingTests[currentTest++]; | 28 iframe.src = "resources/" + encodingTests[currentTest++]; |
| 33 } | 29 } |
| 34 | 30 |
| 31 window.jsTestIsAsync = true; |
| 35 if (window.testRunner) | 32 if (window.testRunner) |
| 36 testRunner.waitUntilDone(); | 33 testRunner.waitUntilDone(); |
| 37 | 34 |
| 38 var iframe = document.createElement("iframe"); | 35 var iframe = document.createElement("iframe"); |
| 39 document.body.appendChild(iframe); | 36 document.body.appendChild(iframe); |
| 40 iframe.onload = runEncodingTest; | 37 iframe.onload = runEncodingTest; |
| 41 runNextTest(); | 38 runNextTest(); |
| OLD | NEW |