diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-11-13 06:20:37 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-11-13 06:20:37 (GMT) |
commit | a69086dd550e97957d985b5ec352f256bb8ddc29 (patch) | |
tree | ddbda4ab4449074c38d82754fc8d4a99a12d1110 /tests/auto/declarative/xmlhttprequest/data/text.qml | |
parent | ec7590bf1b7120dd6948766280917a3db555d97f (diff) | |
parent | 7a05add9235a76f5a3fb721b574c3f41af32ea1f (diff) | |
download | Qt-a69086dd550e97957d985b5ec352f256bb8ddc29.zip Qt-a69086dd550e97957d985b5ec352f256bb8ddc29.tar.gz Qt-a69086dd550e97957d985b5ec352f256bb8ddc29.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/declarative/xmlhttprequest/data/text.qml')
-rw-r--r-- | tests/auto/declarative/xmlhttprequest/data/text.qml | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/tests/auto/declarative/xmlhttprequest/data/text.qml b/tests/auto/declarative/xmlhttprequest/data/text.qml new file mode 100644 index 0000000..8c97504 --- /dev/null +++ b/tests/auto/declarative/xmlhttprequest/data/text.qml @@ -0,0 +1,131 @@ +import Qt 4.6 + +Object { + property bool xmlTest: false + property bool dataOK: false + + Script { + function checkText(text, whitespacetext) + { + if (text == null) + return; + + if (text.nodeName != "#text") + return; + + if (text.nodeValue != "Hello world!") + return; + + if (text.nodeType != 3) + return; + + if (text.parentNode.nodeName != "item") + return; + + if (text.childNodes.length != 0) + return; + + if (text.firstChild != null) + return; + + if (text.lastChild != null) + return; + + if (text.previousSibling != null) + return; + + if (text.nextSibling != null) + return; + + if (text.attributes != null) + return; + + if (text.wholeText != "Hello world!") + return; + + if (text.data != "Hello world!") + return; + + if (text.length != 12) + return; + + if (text.isElementContentWhitespace != false) + return; + + if (whitespacetext.nodeName != "#text") + return; + + if (whitespacetext.nodeValue != " ") + return; + + if (whitespacetext.nodeType != 3) + return; + + if (whitespacetext.parentNode.nodeName != "item") + return; + + if (whitespacetext.childNodes.length != 0) + return; + + if (whitespacetext.firstChild != null) + return; + + if (whitespacetext.lastChild != null) + return; + + if (whitespacetext.previousSibling != null) + return; + + if (whitespacetext.nextSibling != null) + return; + + if (whitespacetext.attributes != null) + return; + + if (whitespacetext.wholeText != " ") + return; + + if (whitespacetext.data != " ") + return; + + if (whitespacetext.length != 3) + return; + + if (whitespacetext.isElementContentWhitespace != true) + return; + + xmlTest = true; + } + + function checkXML(document) + { + checkText(document.documentElement.childNodes[0].childNodes[0], + document.documentElement.childNodes[1].childNodes[0]); + + } + } + + Component.onCompleted: { + var x = new XMLHttpRequest; + + x.open("GET", "text.xml"); + + // Test to the end + x.onreadystatechange = function() { + if (x.readyState == XMLHttpRequest.DONE) { + + dataOK = true; + + if (x.responseXML != null) + checkXML(x.responseXML); + + } + } + + x.send() + } +} + + + + |