aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
diff options
context:
space:
mode:
authorValery Kotov <kotov.valery@gmail.com>2015-06-17 22:37:42 +0300
committerSimon Hausmann <simon.hausmann@qt.io>2016-06-03 13:23:55 +0000
commita8399c5440ef35f8feebcd086b5e46ce0000eea5 (patch)
treea4dfa316790ab991767873a9106fad162a16edcd /tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
parent1f3f6d3e7d81dc11658a46003e86e921edb35bdf (diff)
QML Engine: Support for "PATCH" method for XMLHTTPRequest
Support for HTTP PATCH method was added to QQmlXMLHttpRequest. Tests for PATCH method in XMLHttpRequest were added. [ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now supports the PATCH method in HTTP requests. Task-number: QTBUG-38175 Change-Id: Ib3c104b558f626bb63624e234f1362adcf6cbd4d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp')
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
index 425e12677f..1ce07ecdab 100644
--- a/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
+++ b/tests/auto/qml/qqmlxmlhttprequest/tst_qqmlxmlhttprequest.cpp
@@ -71,6 +71,7 @@ private slots:
void send_withdata_data();
void send_options();
void send_options_data();
+ void send_patch();
void abort();
void abort_unsent();
void abort_opened();
@@ -639,6 +640,26 @@ void tst_qqmlxmlhttprequest::send_options_data()
QTest::newRow("OPTIONS (with data)") << "testdocument.html" << "send_data.10.expect" << "send_data.9.qml" << "send_data.2.reply";
}
+void tst_qqmlxmlhttprequest::send_patch()
+{
+ TestHTTPServer server;
+ QVERIFY2(server.listen(), qPrintable(server.errorString()));
+ QVERIFY(server.wait(testFileUrl("send_patch.expect"),
+ testFileUrl("send_patch.reply"),
+ // the content of response file will be ignored due to 204 status code
+ testFileUrl("testdocument.html")));
+
+ QQmlComponent component(&engine, testFileUrl("send_patch.qml"));
+ QScopedPointer<QObject> object(component.beginCreate(engine.rootContext()));
+ QVERIFY(!object.isNull());
+ object->setProperty("url", server.urlString("/qqmlxmlhttprequest.cpp"));
+ component.completeCreate();
+
+ QTRY_VERIFY(object->property("dataOK").toBool());
+ QTRY_VERIFY(object->property("headerOK").toBool());
+}
+
+
// Test abort() has no effect in unsent state
void tst_qqmlxmlhttprequest::abort_unsent()
{