diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-01-26 11:46:56 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-01-26 11:46:56 +0100 |
commit | 9225ac7348c9023093b6ef8d4519087c7dddeaa2 (patch) | |
tree | 4660e25bd5cfd4a2a40b0ad97ea689c4acb22a8c /tests/auto/qml/qqmlapplicationengine | |
parent | 9d8fe2ac121162c15be6728495be2235b728325a (diff) | |
parent | 0076c44d3993f377ad6417d3bb08109b608dfbd2 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/pointerhandler
Change-Id: I7962fd2282792c43af69784c8e98fb050fd928a7
Diffstat (limited to 'tests/auto/qml/qqmlapplicationengine')
3 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlapplicationengine/data/LocalComponent.qml b/tests/auto/qml/qqmlapplicationengine/data/LocalComponent.qml new file mode 100644 index 0000000000..ece4f45b4a --- /dev/null +++ b/tests/auto/qml/qqmlapplicationengine/data/LocalComponent.qml @@ -0,0 +1,6 @@ +import QtQml 2.0 + +// used in nonResolvedLocal +QtObject { + +} diff --git a/tests/auto/qml/qqmlapplicationengine/data/nonResolvedLocal.qml b/tests/auto/qml/qqmlapplicationengine/data/nonResolvedLocal.qml new file mode 100644 index 0000000000..45a235346d --- /dev/null +++ b/tests/auto/qml/qqmlapplicationengine/data/nonResolvedLocal.qml @@ -0,0 +1,9 @@ +import QtQml 2.0 + +QtObject { + property bool success: true + + property QtObject local: LocalComponent { + } +} + diff --git a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp index 98b92e5fab..74add85cb0 100644 --- a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp +++ b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp @@ -42,6 +42,7 @@ public: private slots: void initTestCase(); void basicLoading(); + void testNonResolvedPath(); void application(); void applicationProperties(); private: @@ -83,6 +84,29 @@ void tst_qqmlapplicationengine::basicLoading() delete test; } +// make sure we resolve a relative URL to an absolute one, otherwise things +// will break. +void tst_qqmlapplicationengine::testNonResolvedPath() +{ + { + // NOTE NOTE NOTE! Missing testFileUrl is *WANTED* here! We want a + // non-resolved URL. + QQmlApplicationEngine test("data/nonResolvedLocal.qml"); + QCOMPARE(test.rootObjects().size(), 1); + QVERIFY(test.rootObjects()[0]); + QVERIFY(test.rootObjects()[0]->property("success").toBool()); + } + { + QQmlApplicationEngine test; + // NOTE NOTE NOTE! Missing testFileUrl is *WANTED* here! We want a + // non-resolved URL. + test.load("data/nonResolvedLocal.qml"); + QCOMPARE(test.rootObjects().size(), 1); + QVERIFY(test.rootObjects()[0]); + QVERIFY(test.rootObjects()[0]->property("success").toBool()); + } +} + void tst_qqmlapplicationengine::application() { /* This test batches together some tests about running an external application |