aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquickworkerscript/data/BaseWorker.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qquickworkerscript/data/BaseWorker.qml')
-rw-r--r--tests/auto/qml/qquickworkerscript/data/BaseWorker.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qml/qquickworkerscript/data/BaseWorker.qml b/tests/auto/qml/qquickworkerscript/data/BaseWorker.qml
new file mode 100644
index 0000000000..0ac56d9b66
--- /dev/null
+++ b/tests/auto/qml/qquickworkerscript/data/BaseWorker.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+
+WorkerScript {
+ id: worker
+
+ property variant response
+
+ signal done()
+
+ function testSend(value) {
+ worker.sendMessage(value)
+ }
+
+ function compareLiteralResponse(expected) {
+ var e = eval('(' + expected + ')')
+ return JSON.stringify(worker.response) == JSON.stringify(e)
+ }
+
+ onMessage: {
+ worker.response = messageObject
+ worker.done()
+ }
+}
+