From f3d40896c1d8601703fcbf30214e22f50eb72727 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 9 Jul 2019 16:39:25 +0200 Subject: Fix promise chaining Fixes: QTBUG-71329 Change-Id: I261b25ff281bb44d03650ab05258743f104f3cc9 Reviewed-by: Ulf Hermann --- tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp') diff --git a/tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp b/tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp index 0f4bb5cdcc..41850d0263 100644 --- a/tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp +++ b/tests/auto/qml/qqmlpromise/tst_qqmlpromise.cpp @@ -82,6 +82,7 @@ private slots: void then_fulfilled_non_callable(); void then_reject_non_callable(); void then_resolve_multiple_then(); + void promiseChain(); private: void execute_test(QString testName); @@ -270,6 +271,20 @@ void tst_qqmlpromise::execute_test(QString testName) QTRY_COMPARE(object->property("wasTestSuccessful").toBool(), true); } +void tst_qqmlpromise::promiseChain() +{ + QQmlEngine engine; + QQmlComponent component(&engine, testFileUrl("promisechain.qml")); + QVERIFY(component.isReady()); + QTest::ignoreMessage(QtDebugMsg, "1"); + QTest::ignoreMessage(QtDebugMsg, "2"); + QTest::ignoreMessage(QtDebugMsg, "3"); + QScopedPointer root(component.create()); + QVERIFY(root); + QTRY_VERIFY(root->property("x") == 42); + +} + QTEST_MAIN(tst_qqmlpromise) -- cgit v1.2.3