summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index df598be..55b4b89 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -1613,6 +1613,18 @@ void tst_qdeclarativetextinput::navigation()
simulateKey(canvas, Qt::Key_Down);
QCOMPARE(input->cursorPosition(),2);
+ // Test left and right navigation works if the TextInput is empty (QTBUG-25447).
+ input->setText(QString());
+ QCOMPARE(input->cursorPosition(), 0);
+ simulateKey(canvas, Qt::Key_Left);
+ QCOMPARE(input->hasActiveFocus(), false);
+ simulateKey(canvas, Qt::Key_Right);
+ QCOMPARE(input->hasActiveFocus(), true);
+ simulateKey(canvas, Qt::Key_Right);
+ QCOMPARE(input->hasActiveFocus(), false);
+ simulateKey(canvas, Qt::Key_Left);
+ QCOMPARE(input->hasActiveFocus(), true);
+
delete canvas;
}