diff options
author | Valery Kotov <kotov.valery@gmail.com> | 2015-03-04 21:57:14 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-03-09 19:41:41 +0000 |
commit | d988310434b00cc0e159fdf6ff3f586eefc47eed (patch) | |
tree | 6dd1bdfb543a3ca8a2a1d0c51273b1e6a9fe5bb8 /tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp | |
parent | 0294702c9c174c67de563cfdea5c32548d111a58 (diff) |
QML Engine: ArrayBuffer XHR response type support
Support for "arraybuffer" response type for QQmlXMLHttpRequest was
added.
[ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now
supports "arraybuffer" binary response type.
Change-Id: I866e543cc7bc6ab037ffff1ef6628057b73daf90
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp')
-rw-r--r-- | tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp index fe1b8b1505..dd70f81d5e 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp +++ b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp @@ -87,6 +87,7 @@ private slots: void getAllResponseHeaders_unsent(); void getAllResponseHeaders_sent(); void getAllResponseHeaders_args(); + void getBinaryData(); void status(); void status_data(); void statusText(); @@ -816,6 +817,24 @@ void tst_qqmlxmlhttprequest::getAllResponseHeaders_args() QTRY_VERIFY(object->property("exceptionThrown").toBool() == true); } +void tst_qqmlxmlhttprequest::getBinaryData() +{ + TestHTTPServer server; + QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString())); + QVERIFY(server.wait(testFileUrl("receive_binary_data.expect"), + testFileUrl("receive_binary_data.reply"), + testFileUrl("qml_logo.png"))); + + QQmlComponent component(&engine, testFileUrl("receiveBinaryData.qml")); + QScopedPointer<QObject> object(component.beginCreate(engine.rootContext())); + QVERIFY(!object.isNull()); + object->setProperty("url", "http://127.0.0.1:14445/gml_logo.png"); + component.completeCreate(); + + QFileInfo fileInfo("data/qml_logo.png"); + QTRY_VERIFY(object->property("readSize").toInt() == fileInfo.size()); +} + void tst_qqmlxmlhttprequest::status() { QFETCH(QUrl, replyUrl); |