diff options
author | Liang Qi <liang.qi@qt.io> | 2018-05-04 09:28:23 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-05-04 10:08:56 +0200 |
commit | 2044d0a03bafa4597863eb2bf3ecb8fa6731ed57 (patch) | |
tree | 5f2c0d44742770dfcc1dabf1efd8021b21cfeba4 /tests/auto/qml/qqmlengine | |
parent | 7b0cb855edcfdeb04e7d0d1c2545958877481ecc (diff) | |
parent | 717b57a9aae4c6d45cbcf91d390e42af56ab8061 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
src/qml/qml/qqmltypeloader.cpp
src/qml/qml/qqmltypeloader_p.h
Done-with: Simon Hausmann <simon.hausmann@qt.io>
Task-number: QTBUG-68091
Change-Id: I7c0ab3c9446ac50da07b58f54e24eb4587f7f28c
Diffstat (limited to 'tests/auto/qml/qqmlengine')
-rw-r--r-- | tests/auto/qml/qqmlengine/data/qrcurls.js | 1 | ||||
-rw-r--r-- | tests/auto/qml/qqmlengine/data/qrcurls.qml | 4 | ||||
-rw-r--r-- | tests/auto/qml/qqmlengine/qqmlengine.pro | 4 | ||||
-rw-r--r-- | tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 23 |
4 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlengine/data/qrcurls.js b/tests/auto/qml/qqmlengine/data/qrcurls.js new file mode 100644 index 0000000000..15a4d5a70c --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/qrcurls.js @@ -0,0 +1 @@ +function someFunction() {} diff --git a/tests/auto/qml/qqmlengine/data/qrcurls.qml b/tests/auto/qml/qqmlengine/data/qrcurls.qml new file mode 100644 index 0000000000..e879577e10 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/qrcurls.qml @@ -0,0 +1,4 @@ +import QtQml 2.0 + +QtObject { +} diff --git a/tests/auto/qml/qqmlengine/qqmlengine.pro b/tests/auto/qml/qqmlengine/qqmlengine.pro index 8d1e149d62..d2eb92bfd5 100644 --- a/tests/auto/qml/qqmlengine/qqmlengine.pro +++ b/tests/auto/qml/qqmlengine/qqmlengine.pro @@ -12,3 +12,7 @@ boot2qt: { # GC corruption test is too heavy for qemu-arm DEFINES += SKIP_GCCORRUPTION_TEST } + +RESOURCES += \ + data/qrcurls.qml \ + data/qrcurls.js diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index 9509db9379..09480a8e1a 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -77,6 +77,7 @@ private slots: void testGCCorruption(); void testGroupedPropertyRevisions(); void componentFromEval(); + void qrcUrls(); public slots: QObject *createAQObjectForOwnershipTest () @@ -897,6 +898,28 @@ void tst_qqmlengine::componentFromEval() QVERIFY(!item.isNull()); } +void tst_qqmlengine::qrcUrls() +{ + QQmlEngine engine; + QQmlEnginePrivate *pEngine = QQmlEnginePrivate::get(&engine); + + { + QQmlRefPointer<QQmlTypeData> oneQml(pEngine->typeLoader.getType(QUrl("qrc:/qrcurls.qml"))); + QVERIFY(oneQml.data() != nullptr); + QQmlRefPointer<QQmlTypeData> twoQml(pEngine->typeLoader.getType(QUrl("qrc:///qrcurls.qml"))); + QVERIFY(twoQml.data() != nullptr); + QCOMPARE(oneQml.data(), twoQml.data()); + } + + { + QQmlRefPointer<QQmlTypeData> oneJS(pEngine->typeLoader.getType(QUrl("qrc:/qrcurls.js"))); + QVERIFY(oneJS.data() != nullptr); + QQmlRefPointer<QQmlTypeData> twoJS(pEngine->typeLoader.getType(QUrl("qrc:///qrcurls.js"))); + QVERIFY(twoJS.data() != nullptr); + QCOMPARE(oneJS.data(), twoJS.data()); + } +} + QTEST_MAIN(tst_qqmlengine) #include "tst_qqmlengine.moc" |