From 5ec3b2826b3f4c80adc3ed8f5aa290e6c1a2f2ec Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 10 Jul 2013 14:20:37 +0200 Subject: Test password mask delay and characters on Mac. Task-number: QTBUG-31498 Change-Id: Iab4a56b94364e3db78070aca40c629f9398ffbb7 Reviewed-by: Gabriel de Dietrich --- tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/auto/widgets/styles') diff --git a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp index 7925820b70..e942f13562 100644 --- a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp +++ b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp @@ -87,6 +87,7 @@ private slots: void layoutSpacings(); void smallMiniNormalExclusivity_data(); void smallMiniNormalExclusivity(); + void passwordCharacter(); private: static QSize msh(QWidget *widget); @@ -405,6 +406,17 @@ void tst_QMacStyle::smallMiniNormalExclusivity() } } +void tst_QMacStyle::passwordCharacter() +{ + QLineEdit lineEdit; + lineEdit.setEchoMode(QLineEdit::Password); + QTest::keyClick(&lineEdit, Qt::Key_P); + // Should be no password delay; text should instantly be masked. + const QChar bullet(0x2022); + const QString expected(1, bullet); + QCOMPARE(lineEdit.displayText(), expected); +} + QTEST_MAIN(tst_QMacStyle) #include "tst_qmacstyle.moc" -- cgit v1.2.3