summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-08-17 02:52:09 (GMT)
committerTimo Turunen <timo.p.turunen@nokia.com>2011-08-30 07:02:14 (GMT)
commitb7f1dc2da720ba371b7f46f168ea271f0372c7f6 (patch)
tree419c0ca86b077c0f05ed4a393e6701b92489f1cd /tests
parent11510d003d7eb7838183039d751d76dca6851a68 (diff)
downloadQt-b7f1dc2da720ba371b7f46f168ea271f0372c7f6.zip
Qt-b7f1dc2da720ba371b7f46f168ea271f0372c7f6.tar.gz
Qt-b7f1dc2da720ba371b7f46f168ea271f0372c7f6.tar.bz2
Fix delayed password masking mid-string.
Unmask the last character typed, not the last character in the string. Change-Id: I9c70d2347bf878c18ab0a7f4ea76f755ca19a85c Task-number: QTBUG-17003 Reviewed-by: Alan Alpert (cherry picked from commit b98e9e69dd8ba33d5f01b9518d95b63b86c4b443) Reapplied after bad v4.7.4 merge
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 1f33458..3276375 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -1764,6 +1764,13 @@ void tst_QLineEdit::passwordEchoDelay()
QApplication::sendEvent(testWidget, &ev);
QCOMPARE(testWidget->displayText(), QString(7, fillChar) + QLatin1Char('7'));
+ testWidget->setCursorPosition(3);
+ QCOMPARE(testWidget->displayText(), QString(7, fillChar) + QLatin1Char('7'));
+ QTest::keyPress(testWidget, 'a');
+ QCOMPARE(testWidget->displayText(), QString(3, fillChar) + QLatin1Char('a') + QString(5, fillChar));
+ QTest::keyPress(testWidget, Qt::Key_Backspace);
+ QCOMPARE(testWidget->displayText(), QString(8, fillChar));
+
// restore clean state
testWidget->setEchoMode(QLineEdit::Normal);
}