diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-25 06:06:59 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-25 06:06:59 (GMT) |
commit | 4f007625bf98077d1913f004ffff62383c3d9379 (patch) | |
tree | d68e7a3e027ec08b0fe28a96c0febf76cbea54c4 /tests/auto/declarative | |
parent | 82ba28a874eebdbff831a7c6f7fb9d7458804748 (diff) | |
download | Qt-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.qml | 12 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 13 |
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() { |