~loic.molinari/+junk/qtdeclarative-shadereffectsource-changes

« back to all changes in this revision

Viewing changes to tests/auto/qml/qqmlxmlhttprequest/data/document.qml

  • Committer: Loïc Molinari
  • Date: 2012-04-21 17:59:51 UTC
  • Revision ID: loic.molinari@canonical.com-20120421175951-bqx68caaf5zrp76l
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
QtObject {
 
4
    property bool xmlTest: false
 
5
    property bool dataOK: false
 
6
 
 
7
    function checkXML(document)
 
8
    {
 
9
        if (document.xmlVersion != "1.0")
 
10
            return;
 
11
 
 
12
        if (document.xmlEncoding != "UTF-8")
 
13
            return;
 
14
 
 
15
        if (document.xmlStandalone != true)
 
16
            return;
 
17
 
 
18
        if (document.documentElement == null)
 
19
            return;
 
20
 
 
21
        if (document.nodeName != "#document")
 
22
            return;
 
23
 
 
24
        if (document.nodeValue != null)
 
25
            return;
 
26
 
 
27
        if (document.parentNode != null)
 
28
            return;
 
29
 
 
30
        // ### Test other node properties
 
31
        // ### test encoding (what is a valid qt encoding?)
 
32
        xmlTest = true;
 
33
    }
 
34
 
 
35
    Component.onCompleted: {
 
36
        var x = new XMLHttpRequest;
 
37
 
 
38
        x.open("GET", "document.xml");
 
39
 
 
40
        // Test to the end
 
41
        x.onreadystatechange = function() {
 
42
            if (x.readyState == XMLHttpRequest.DONE) {
 
43
 
 
44
                dataOK = true;
 
45
 
 
46
                if (x.responseXML != null)
 
47
                    checkXML(x.responseXML);
 
48
 
 
49
            }
 
50
        }
 
51
 
 
52
        x.send()
 
53
    }
 
54
}
 
55
 
 
56