aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-06-04 10:45:14 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2018-06-04 10:45:14 +0200
commit3ca5f33c8b9c273f0169ec4c11417328f8071e97 (patch)
tree155da80482fb4593ca074f7a1bf9b22d031dba4a /tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
parent5f4698c4e7952d64e78e3a06de5ac28d68415b19 (diff)
parentb7a1bcd83a8f68185b617b860cef6f2d2d7c8d9b (diff)
Merge remote-tracking branch 'gerrit/5.11' into wip/webassembly
Diffstat (limited to 'tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp')
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp14
1 files changed, 14 insertions, 0 deletions
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"