aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp19
-rw-r--r--tests/auto/qmltest/BLACKLIST6
2 files changed, 22 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
index f7748b2da9..daeb9b5455 100644
--- a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
+++ b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
@@ -28,6 +28,7 @@
#include "../../shared/util.h"
#include <QQmlApplicationEngine>
+#include <QScopedPointer>
#include <QSignalSpy>
#if QT_CONFIG(process)
#include <QProcess>
@@ -47,6 +48,7 @@ private slots:
void testNonResolvedPath();
void application();
void applicationProperties();
+ void removeObjectsWhenDestroyed();
private:
QString buildDir;
QString srcDir;
@@ -201,6 +203,23 @@ void tst_qqmlapplicationengine::applicationProperties()
delete test;
}
+void tst_qqmlapplicationengine::removeObjectsWhenDestroyed()
+{
+ QScopedPointer<QQmlApplicationEngine> test(new QQmlApplicationEngine);
+ QVERIFY(test->rootObjects().isEmpty());
+
+ QSignalSpy objectCreated(test.data(), SIGNAL(objectCreated(QObject*,QUrl)));
+ test->load(testFileUrl("basicTest.qml"));
+ QCOMPARE(objectCreated.count(), 1);
+
+ QSignalSpy objectDestroyed(test->rootObjects().first(), SIGNAL(destroyed()));
+ test->rootObjects().first()->deleteLater();
+ objectDestroyed.wait();
+ QCOMPARE(objectDestroyed.count(), 1);
+ QCOMPARE(test->rootObjects().size(), 0);
+}
+
+
QTEST_MAIN(tst_qqmlapplicationengine)
#include "tst_qqmlapplicationengine.moc"
diff --git a/tests/auto/qmltest/BLACKLIST b/tests/auto/qmltest/BLACKLIST
index e0a4ce1743..9b39f87219 100644
--- a/tests/auto/qmltest/BLACKLIST
+++ b/tests/auto/qmltest/BLACKLIST
@@ -9,8 +9,8 @@ linux
linux
[ListView::test_listInteractiveCurrentIndexEnforce]
linux
-macos-10.12
+osx-10.12
[TextEdit::test_textentry]
-macos-10.12
+osx-10.12
[TextEdit::test_textentry_char]
-macos-10.12
+osx-10.12