diff options
author | Liang Qi <liang.qi@qt.io> | 2018-03-21 11:43:47 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-03-21 11:43:47 +0100 |
commit | 089e5f7822e6d64e8e5864806929d29fd735fb0d (patch) | |
tree | bb0c4f173067e8a498c70e218f0b8c0c82a5525f /tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp | |
parent | bc4455cda2ae395f2943cd9f18b6ae51a676399a (diff) | |
parent | 1a816cd8dcc3499351ce6dfb6ad3bdfb34c31ede (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
tests/auto/qml/qjsengine/tst_qjsengine.cpp
Change-Id: I25e264df273c01832f64dbd31923d8529f1d1900
Diffstat (limited to 'tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp')
-rw-r--r-- | tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp index d01d9a6791..89217e7556 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp @@ -141,6 +141,7 @@ private slots: void queryObjectWithNonStreamableTypes(); void asynchronousCreate(); void invalidContexts(); + void createObjectOnDestruction(); }; QmlDebugObjectReference tst_QQmlEngineDebugService::findRootObject( @@ -1345,6 +1346,29 @@ void tst_QQmlEngineDebugService::invalidContexts() QCOMPARE(m_dbg->rootContext().contexts.count(), 0); } +void tst_QQmlEngineDebugService::createObjectOnDestruction() +{ + QSignalSpy spy(m_dbg, SIGNAL(newObject(int))); + { + QQmlEngine engine; + QQmlComponent component(&engine); + component.setData( + "import QtQml 2.0;" + "QtObject {" + "property Component x:" + "Qt.createQmlObject('import QtQml 2.0; Component { QtObject { } }'," + "this, 'x.qml');" + "Component.onDestruction: x.createObject(this, {});" + "}", QUrl::fromLocalFile("x.qml")); + QVERIFY(component.isReady()); + QVERIFY(component.create()); + QTRY_COMPARE(spy.count(), 2); + } + // Doesn't crash and doesn't give us another signal for the object created on destruction. + QTest::qWait(500); + QCOMPARE(spy.count(), 2); +} + int main(int argc, char *argv[]) { int _argc = argc + 1; |