summaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlpromise/data/promisechain.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlpromise/data/promisechain.qml')
-rw-r--r--tests/auto/qml/qqmlpromise/data/promisechain.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlpromise/data/promisechain.qml b/tests/auto/qml/qqmlpromise/data/promisechain.qml
new file mode 100644
index 0000000000..fa1809aef0
--- /dev/null
+++ b/tests/auto/qml/qqmlpromise/data/promisechain.qml
@@ -0,0 +1,24 @@
+import QtQml 2.0
+
+QtObject {
+ property int x: 0
+ id: root;
+ Component.onCompleted: {
+ new Promise((res) => {
+ res(1)
+ })
+ .then((data) => {
+ console.debug(data)
+ return new Promise((res) => {res(2)});
+ })
+ .then((data) => {
+ console.debug(data)
+ return new Promise((res) => {res(3)});
+ })
+ .then((data) => {
+ console.debug(data);
+ root.x = 42;
+ });
+ }
+
+}