diff options
author | Tasuku Suzuki <stasuku@gmail.com> | 2014-11-30 01:40:42 +0900 |
---|---|---|
committer | Tasuku Suzuki <stasuku@gmail.com> | 2014-12-26 04:39:46 +0100 |
commit | f8beab1d7390095114e1d5f02097751dd1b07345 (patch) | |
tree | 87e668f21ac1f010f7a635c826b928df183c1814 /tests/auto/qml/qqmlxmlhttprequest/data | |
parent | d641008d04475bfb1c1996e408b1408618845b6f (diff) |
support XMLHttpRequest sync mode
[ChangeLog][QtQml][XMLHttpRequest] Supported synchronous requests
Change-Id: Ia38fcf97f212a14657bb519240d8406368a72390
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/data')
-rw-r--r-- | tests/auto/qml/qqmlxmlhttprequest/data/open_sync.qml | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/open_sync.qml b/tests/auto/qml/qqmlxmlhttprequest/data/open_sync.qml index 0f31c966fa..3c73141954 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/data/open_sync.qml +++ b/tests/auto/qml/qqmlxmlhttprequest/data/open_sync.qml @@ -1,17 +1,15 @@ import QtQuick 2.0 QtObject { - property bool exceptionThrown: false + property url url + property string responseText Component.onCompleted: { var x = new XMLHttpRequest; - - try { - x.open("GET", "http://www.qt-project.org", false); - } catch (e) { - if (e.code == DOMException.NOT_SUPPORTED_ERR) - exceptionThrown = true; - } + x.open("GET", url, false); + x.setRequestHeader("Accept-Language", "en-US"); + x.send(); + responseText = x.responseText; } } |