~ubuntu-branches/ubuntu/saucy/qtdeclarative-opensource-src/saucy

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 14:17:19 UTC
  • Revision ID: package-import@ubuntu.com-20130205141719-qqeyml8wslpyez52
Tags: upstream-5.0.1
ImportĀ upstreamĀ versionĀ 5.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
QtObject {
 
4
    property string url
 
5
 
 
6
    property bool dataOK: false
 
7
    property bool done: false
 
8
        
 
9
    Component.onCompleted: {
 
10
        var x = new XMLHttpRequest;
 
11
        x.open("GET", url);
 
12
 
 
13
        x.onreadystatechange = function() {
 
14
            if (x.readyState == XMLHttpRequest.DONE) {
 
15
                done = true;
 
16
                dataOK = x.status == 302;
 
17
            }
 
18
        }
 
19
 
 
20
        x.send();
 
21
    }
 
22
}
 
23