summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlecmascript/data
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-10-07 05:18:06 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-10-07 05:18:51 (GMT)
commit07b3465405ccd59dc5c447cffc47cc1a17f674f0 (patch)
tree7b5d0d535b1a4ae27ea3383b03a5dafed935b19d /tests/auto/declarative/qmlecmascript/data
parent19d080d319dccac15654294af80530bed9ef11ea (diff)
downloadQt-07b3465405ccd59dc5c447cffc47cc1a17f674f0.zip
Qt-07b3465405ccd59dc5c447cffc47cc1a17f674f0.tar.gz
Qt-07b3465405ccd59dc5c447cffc47cc1a17f674f0.tar.bz2
Add three failing tests to the QML ECMAscript autotest
Tests the creation, deletion and toString functions for QML objects. Task-number: QT-2252
Diffstat (limited to 'tests/auto/declarative/qmlecmascript/data')
-rw-r--r--tests/auto/declarative/qmlecmascript/data/dynamicCreation.helper.qml5
-rw-r--r--tests/auto/declarative/qmlecmascript/data/dynamicCreation.qml16
-rw-r--r--tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml20
-rw-r--r--tests/auto/declarative/qmlecmascript/data/qmlToString.qml11
4 files changed, 52 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/dynamicCreation.helper.qml b/tests/auto/declarative/qmlecmascript/data/dynamicCreation.helper.qml
new file mode 100644
index 0000000..58ca26e
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/dynamicCreation.helper.qml
@@ -0,0 +1,5 @@
+import Qt.Test 1.0
+
+MyQmlObject{
+ objectName: "desolateObject"
+}
diff --git a/tests/auto/declarative/qmlecmascript/data/dynamicCreation.qml b/tests/auto/declarative/qmlecmascript/data/dynamicCreation.qml
new file mode 100644
index 0000000..f3eb75f
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/dynamicCreation.qml
@@ -0,0 +1,16 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "obj"
+ function createOne()
+ {
+ obj.objectProperty = createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"emptyObject"}', obj);
+ }
+
+ function createTwo()
+ {
+ var component = createComponent('dynamicCreation.helper.qml');
+ obj.objectProperty = component.createObject();
+ }
+}
diff --git a/tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml b/tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml
new file mode 100644
index 0000000..618723f
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/dynamicDeletion.qml
@@ -0,0 +1,20 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "obj"
+ function create()
+ {
+ obj.objectProperty = createQmlObject('import Qt.test 1.0; MyQmlObject{objectName:"emptyObject"}', obj);
+ }
+
+ function killIt(wait)
+ {
+ if(obj.objectProperty == undefined || obj.objectProperty == null)
+ return;
+ if(wait > 0)
+ obj.objectProperty.destroy(wait);
+ else
+ obj.objectProperty.destroy();
+ }
+}
diff --git a/tests/auto/declarative/qmlecmascript/data/qmlToString.qml b/tests/auto/declarative/qmlecmascript/data/qmlToString.qml
new file mode 100644
index 0000000..ac296ce
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/qmlToString.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+
+MyQmlObject{
+ id: obj
+ objectName: "objName"
+ function testToString()
+ {
+ obj.stringProperty = obj.toString();
+ }
+
+}