aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquickworkerscript/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qquickworkerscript/data')
-rw-r--r--tests/auto/qml/qquickworkerscript/data/BaseWorker.qml4
-rw-r--r--tests/auto/qml/qquickworkerscript/data/doRequest.mjs6
-rw-r--r--tests/auto/qml/qquickworkerscript/data/xmlHttpRequest.qml16
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qml/qquickworkerscript/data/BaseWorker.qml b/tests/auto/qml/qquickworkerscript/data/BaseWorker.qml
index 0ac56d9b66..59af114379 100644
--- a/tests/auto/qml/qquickworkerscript/data/BaseWorker.qml
+++ b/tests/auto/qml/qquickworkerscript/data/BaseWorker.qml
@@ -4,8 +4,10 @@ WorkerScript {
id: worker
property variant response
+ property bool readyChangedCalled : false
signal done()
+ signal ready()
function testSend(value) {
worker.sendMessage(value)
@@ -20,5 +22,7 @@ WorkerScript {
worker.response = messageObject
worker.done()
}
+
+ onReadyChanged: worker.readyChangedCalled = true
}
diff --git a/tests/auto/qml/qquickworkerscript/data/doRequest.mjs b/tests/auto/qml/qquickworkerscript/data/doRequest.mjs
new file mode 100644
index 0000000000..d607c3400d
--- /dev/null
+++ b/tests/auto/qml/qquickworkerscript/data/doRequest.mjs
@@ -0,0 +1,6 @@
+WorkerScript.onMessage = function(message)
+{
+ var req = new XMLHttpRequest();
+ req.open("GET", message.url, true);
+ req.send();
+};
diff --git a/tests/auto/qml/qquickworkerscript/data/xmlHttpRequest.qml b/tests/auto/qml/qquickworkerscript/data/xmlHttpRequest.qml
new file mode 100644
index 0000000000..42136d78f0
--- /dev/null
+++ b/tests/auto/qml/qquickworkerscript/data/xmlHttpRequest.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.14
+
+Rectangle
+{
+ width: 100
+ height: 100
+
+ WorkerScript
+ {
+ source: "doRequest.mjs"
+ Component.onCompleted:
+ {
+ sendMessage({"url": "https://example.com"});
+ }
+ }
+}