invalid-xml.js revision fd5c6425ce58eb75211be7718d5dee960842a37e
1// test 70: XML encoding test
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 errors
4
5function runEncodingTest(event)
6{
7    debug("Testing: " + encodingTests[currentTest-1]);
8    shouldBeEqualToString("iframe.contentDocument.documentElement.tagName", "root");
9    shouldBeTrue("iframe.contentDocument.documentElement.getElementsByTagName('test').length < 1");
10    setTimeout(runNextTest, 0);
11}
12
13var currentTest = 0;
14var encodingTests = [
15    "invalid-xml-utf8.xml",
16    "invalid-xml-utf16.xml",
17    "invalid-xml-shift-jis.xml",
18    "invalid-xml-x-mac-thai.xml",
19];
20
21function runNextTest()
22{
23    if (currentTest >= encodingTests.length) {
24        var script = document.createElement("script");
25        script.src = "../js/resources/js-test-post.js";
26        if (window.layoutTestController)
27            script.setAttribute("onload", "layoutTestController.notifyDone()");
28        document.body.appendChild(script);
29        iframe.parentNode.removeChild(iframe);
30        return;
31    }
32    iframe.src = "resources/" + encodingTests[currentTest++];
33}
34
35if (window.layoutTestController)
36    layoutTestController.waitUntilDone();
37
38var iframe = document.createElement("iframe");
39document.body.appendChild(iframe);
40iframe.onload = runEncodingTest;
41runNextTest();
42
43var successfullyParsed = true;
44