diff options
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp')
-rw-r--r-- | tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp | 18 |
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 6a0dc28ca4..3a70890362 100644 --- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp +++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp @@ -117,6 +117,7 @@ private slots: void recursion(); void recursionContinuation(); void callingContextForInitialProperties(); + void setNonExistentInitialProperty(); void relativeUrl_data(); void relativeUrl(); @@ -583,6 +584,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"); |