summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-10-04 06:44:32 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-10-04 06:48:29 (GMT)
commitf25391e52af3eef68abfa3941fc48da0c52bb010 (patch)
tree0b8f02830dc0b81b144867c33253823ecc60ca2f /tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
parentda45259dbfa05c4f3b6c8c0472a65851692060e4 (diff)
downloadQt-f25391e52af3eef68abfa3941fc48da0c52bb010.zip
Qt-f25391e52af3eef68abfa3941fc48da0c52bb010.tar.gz
Qt-f25391e52af3eef68abfa3941fc48da0c52bb010.tar.bz2
Improve test coverage for declarative module.
Add additional autotests, and remove unreachable functions.
Diffstat (limited to 'tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
index e9dad6b..bbbf73e 100644
--- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
+++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp
@@ -214,6 +214,9 @@ void tst_QDeclarativeItem::keys()
QFocusEvent fe(QEvent::FocusIn);
QApplication::sendEvent(canvas, &fe);
+ QVERIFY(canvas->rootObject());
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true);
+
QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1);
QApplication::sendEvent(canvas, &key);
QCOMPARE(testObject->mKey, int(Qt::Key_A));
@@ -285,6 +288,7 @@ void tst_QDeclarativeItem::keys()
testObject->reset();
canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(false));
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), false);
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
QApplication::sendEvent(canvas, &key);
@@ -292,6 +296,7 @@ void tst_QDeclarativeItem::keys()
QVERIFY(!key.isAccepted());
canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true));
+ QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true);
key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1);
QApplication::sendEvent(canvas, &key);