aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickloader/tst_qquickloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickloader/tst_qquickloader.cpp')
-rw-r--r--tests/auto/quick/qquickloader/tst_qquickloader.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
index d0a1a8a45b..7bd6f9466a 100644
--- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp
+++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
@@ -39,6 +39,7 @@
#include "testhttpserver.h"
#include "../../shared/util.h"
#include "../shared/geometrytestutil.h"
+#include <QQmlApplicationEngine>
Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests")
@@ -128,6 +129,7 @@ private slots:
void rootContext();
void sourceURLKeepComponent();
+ void statusChangeOnlyEmittedOnce();
};
Q_DECLARE_METATYPE(QList<QQmlError>)
@@ -1446,6 +1448,18 @@ void tst_QQuickLoader::sourceURLKeepComponent()
}
+// QTBUG-82002
+void tst_QQuickLoader::statusChangeOnlyEmittedOnce()
+{
+ QQmlApplicationEngine engine;
+ auto url = testFileUrl("statusChanged.qml");
+ engine.load(url);
+ auto root = engine.rootObjects().at(0);
+ QVERIFY(root);
+ QTRY_COMPARE(QQuickLoader::Status(root->property("status").toInt()), QQuickLoader::Ready);
+ QCOMPARE(root->property("statusChangedCounter").toInt(), 2); // 1xLoading + 1xReady*/
+}
+
QTEST_MAIN(tst_QQuickLoader)
#include "tst_qquickloader.moc"