aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlmetatype
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlmetatype')
-rw-r--r--tests/auto/qml/qqmlmetatype/qqmlmetatype.pro4
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp14
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
index 0d8de91931..345bc59615 100644
--- a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
+++ b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
@@ -6,4 +6,8 @@ macx:CONFIG -= app_bundle
TESTDATA = data/*
include (../../shared/util.pri)
+qmlfiles.files = data/CompositeType.qml
+qmlfiles.prefix = /tstqqmlmetatype
+RESOURCES += qmlfiles
+
QT += core-private gui-private qml-private testlib
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index ff3361ff82..1d0d353668 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -62,6 +62,8 @@ private slots:
void defaultObject();
void unregisterCustomType();
void unregisterCustomSingletonType();
+
+ void normalizeUrls();
};
class TestType : public QObject
@@ -523,6 +525,18 @@ void tst_qqmlmetatype::unregisterCustomSingletonType()
}
}
+void tst_qqmlmetatype::normalizeUrls()
+{
+ const QUrl url("qrc:///tstqqmlmetatype/data/CompositeType.qml");
+ QVERIFY(!QQmlMetaType::qmlType(url).isValid());
+ const auto registrationId = qmlRegisterType(url, "Test", 1, 0, "ResourceCompositeType");
+ QVERIFY(QQmlMetaType::qmlType(url, /*includeNonFileImports=*/true).isValid());
+ QUrl normalizedURL("qrc:/tstqqmlmetatype/data/CompositeType.qml");
+ QVERIFY(QQmlMetaType::qmlType(normalizedURL, /*includeNonFileImports=*/true).isValid());
+ qmlUnregisterType(registrationId);
+ QVERIFY(!QQmlMetaType::qmlType(url, /*includeNonFileImports=*/true).isValid());
+}
+
QTEST_MAIN(tst_qqmlmetatype)
#include "tst_qqmlmetatype.moc"