aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-08-04 15:27:24 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-08-06 09:56:49 +0200
commit2121de6d8762ec2fc90a07e207824090e8447291 (patch)
treef061114b33c8b52ecc947e7b69bd7d0eef126a42 /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parentc85bfba382ca1ddf0573c8f59e95b25f804b83ff (diff)
Fix Qt.include with cached compilation units and resources
Similar to the worker scripts we also need to do a lookup for cached scripts here. Added also a test to ensure that Qt.include works correctly from Qt resources. Change-Id: Idb67af3da4b0cc91edbd3d2746d074fd68ed8bf0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index a9486a8e63..34413b23de 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -6016,6 +6016,23 @@ void tst_qqmlecmascript::include()
delete o;
}
+
+ // include from resources
+ {
+ QQmlComponent component(&engine, QUrl("qrc:///data/include.qml"));
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ QCOMPARE(o->property("test0").toInt(), 99);
+ QCOMPARE(o->property("test1").toBool(), true);
+ QCOMPARE(o->property("test2").toBool(), true);
+ QCOMPARE(o->property("test2_1").toBool(), true);
+ QCOMPARE(o->property("test3").toBool(), true);
+ QCOMPARE(o->property("test3_1").toBool(), true);
+
+ delete o;
+ }
+
}
void tst_qqmlecmascript::includeRemoteSuccess()