aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-05-24 08:57:40 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-24 09:15:57 +0200
commitb254bbb82b7d1b42950c4267d8e618b570f88cc6 (patch)
treec8f9fd1fcbd5c5d4a75ffea79ee623ce59e9ae9b /tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
parent1b0e6861ba7af231c29ebba10c93976845f7f78d (diff)
parent5b8a94eb8e5d4e3b79ab73a9a0325f838ecbe41a (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp')
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index 0263115db8..efd5bb571b 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -118,6 +118,7 @@ private slots:
void recursionContinuation();
void partialComponentCreation();
void callingContextForInitialProperties();
+ void setNonExistentInitialProperty();
void relativeUrl_data();
void relativeUrl();
@@ -607,6 +608,23 @@ void tst_qqmlcomponent::callingContextForInitialProperties()
QVERIFY(checker->scopeObject->metaObject()->indexOfProperty("incubatedObject") != -1);
}
+void tst_qqmlcomponent::setNonExistentInitialProperty()
+{
+ QQmlIncubationController controller;
+ QQmlEngine engine;
+ engine.setIncubationController(&controller);
+ QQmlComponent component(&engine, testFileUrl("nonExistentInitialProperty.qml"));
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY(!obj.isNull());
+ QMetaObject::invokeMethod(obj.data(), "startIncubation");
+ QJSValue incubatorStatus = obj->property("incubator").value<QJSValue>();
+ incubatorStatus.property("forceCompletion").callWithInstance(incubatorStatus);
+ QJSValue objectWrapper = incubatorStatus.property("object");
+ QVERIFY(objectWrapper.isQObject());
+ QPointer<QObject> object(objectWrapper.toQObject());
+ QVERIFY(object->property("ok").toBool());
+}
+
void tst_qqmlcomponent::relativeUrl_data()
{
QTest::addColumn<QUrl>("url");