summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-02-09 11:12:31 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-09 03:44:50 +0100
commit5ba6373453cb6be36ea8090f2fdb7ac3e60d286f (patch)
tree207e9e0333c7b81ed9ceaac041f809429719fa6a /tests/auto
parent5060b58fdde00ca3fa4dc29bd58b80138a271b10 (diff)
Don't crash if focus issues arise.
The test has some strict focus requirements, but if they are not met then the test should FAIL with a bit of explanation instead of crash. Change-Id: I796e8a8092833f3413b3dc98a22466575dfe241d Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp
index 8cc89717d0..38aad48a74 100644
--- a/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp
@@ -1527,6 +1527,7 @@ void tst_qquicktextinput::positionAt()
textinputObject->setCursorPosition(0);
{ QInputMethodEvent inputEvent(preeditText, QList<QInputMethodEvent::Attribute>());
+ QVERIFY(qGuiApp->focusObject());
QGuiApplication::sendEvent(qGuiApp->focusObject(), &inputEvent); }
// Check all points within the preedit text return the same position.
@@ -1539,6 +1540,7 @@ void tst_qquicktextinput::positionAt()
QCOMPARE(textinputObject->positionToRectangle(1).x(), x1);
{ QInputMethodEvent inputEvent;
+ QVERIFY(qGuiApp->focusObject());
QGuiApplication::sendEvent(qGuiApp->focusObject(), &inputEvent); }
// With wrapping.