diff options
author | Iain Merrick <husky@google.com> | 2010-09-29 10:59:30 +0100 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-09-29 16:27:50 +0100 |
commit | fd5c6425ce58eb75211be7718d5dee960842a37e (patch) | |
tree | fdcd1da6ceced587fa315991889655ca4105efb1 /LayoutTests/fast/encoding/resources/invalid-xml.js | |
parent | a477fea25b6f689360fd2b6a69ee21c3627d3b04 (diff) | |
download | external_webkit-fd5c6425ce58eb75211be7718d5dee960842a37e.zip external_webkit-fd5c6425ce58eb75211be7718d5dee960842a37e.tar.gz external_webkit-fd5c6425ce58eb75211be7718d5dee960842a37e.tar.bz2 |
Add fast/encoding layout tests.
Merged from WebKit at r67178.
The vast majority of these are passing. The exceptions:
- Three Mac-specific tests, won't fix.
- Four failures in the Java HTTP stack (no problem for the Chrome HTTP stack).
- fast/encoding/mailto-always-utf-8 needs a new LayoutTestController callback.
Change-Id: I16c613d42acd0ea2dc146909d514376d0a2e5aaa
Diffstat (limited to 'LayoutTests/fast/encoding/resources/invalid-xml.js')
-rw-r--r-- | LayoutTests/fast/encoding/resources/invalid-xml.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/LayoutTests/fast/encoding/resources/invalid-xml.js b/LayoutTests/fast/encoding/resources/invalid-xml.js new file mode 100644 index 0000000..e241a0c --- /dev/null +++ b/LayoutTests/fast/encoding/resources/invalid-xml.js @@ -0,0 +1,43 @@ +// test 70: XML encoding test +// q.v. XML 1.0, section 4.3.3 Character Encoding in Entities +// this only tests one of a large number of conditions that should cause fatal errors + +function runEncodingTest(event) +{ + debug("Testing: " + encodingTests[currentTest-1]); + shouldBeEqualToString("iframe.contentDocument.documentElement.tagName", "root"); + shouldBeTrue("iframe.contentDocument.documentElement.getElementsByTagName('test').length < 1"); + setTimeout(runNextTest, 0); +} + +var currentTest = 0; +var encodingTests = [ + "invalid-xml-utf8.xml", + "invalid-xml-utf16.xml", + "invalid-xml-shift-jis.xml", + "invalid-xml-x-mac-thai.xml", +]; + +function runNextTest() +{ + if (currentTest >= encodingTests.length) { + var script = document.createElement("script"); + script.src = "../js/resources/js-test-post.js"; + if (window.layoutTestController) + script.setAttribute("onload", "layoutTestController.notifyDone()"); + document.body.appendChild(script); + iframe.parentNode.removeChild(iframe); + return; + } + iframe.src = "resources/" + encodingTests[currentTest++]; +} + +if (window.layoutTestController) + layoutTestController.waitUntilDone(); + +var iframe = document.createElement("iframe"); +document.body.appendChild(iframe); +iframe.onload = runEncodingTest; +runNextTest(); + +var successfullyParsed = true; |