summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-01-25 06:06:59 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-01-25 06:06:59 (GMT)
commit4f007625bf98077d1913f004ffff62383c3d9379 (patch)
treed68e7a3e027ec08b0fe28a96c0febf76cbea54c4 /tests/auto/declarative
parent82ba28a874eebdbff831a7c6f7fb9d7458804748 (diff)
downloadQt-4f007625bf98077d1913f004ffff62383c3d9379.zip
Qt-4f007625bf98077d1913f004ffff62383c3d9379.tar.gz
Qt-4f007625bf98077d1913f004ffff62383c3d9379.tar.bz2
Test QML doesn't hijack JS Object
QTBUG-5759
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qmlecmascript/data/jsObject.qml12
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp13
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/jsObject.qml b/tests/auto/declarative/qmlecmascript/data/jsObject.qml
new file mode 100644
index 0000000..4128c92
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/jsObject.qml
@@ -0,0 +1,12 @@
+import Qt 4.6
+
+QtObject {
+ property int test
+
+ Component.onCompleted: {
+ var o = new Object;
+ o.test = 92;
+ test = o.test;
+ }
+}
+
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index ba23ef8..4c9721a 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -115,6 +115,7 @@ private slots:
void shutdownErrors();
void externalScript();
void compositePropertyType();
+ void jsObject();
void bug1();
@@ -1062,6 +1063,18 @@ void tst_qmlecmascript::compositePropertyType()
delete object;
}
+// QTBUG-5759
+void tst_qmlecmascript::jsObject()
+{
+ QmlComponent component(&engine, TEST_FILE("jsObject.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("test").toInt(), 92);
+
+ delete object;
+}
+
// QTBUG-6781
void tst_qmlecmascript::bug1()
{