diff options
Diffstat (limited to 'src/tests')
| -rw-r--r-- | src/tests/kitemlistkeyboardsearchmanagertest.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tests/kitemlistkeyboardsearchmanagertest.cpp b/src/tests/kitemlistkeyboardsearchmanagertest.cpp index 14a09a31c..aeca1f779 100644 --- a/src/tests/kitemlistkeyboardsearchmanagertest.cpp +++ b/src/tests/kitemlistkeyboardsearchmanagertest.cpp @@ -65,6 +65,10 @@ void KItemListKeyboardSearchManagerTest::testBasicKeyboardSearch() void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch() { + // Set the timeout to a small value (the default is 5000 milliseconds) + // to save time when running this test. + m_keyboardSearchManager.setTimeout(100); + QSignalSpy spy(&m_keyboardSearchManager, SIGNAL(changeCurrentItem(QString,bool))); m_keyboardSearchManager.addKeys("f"); @@ -75,9 +79,9 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch() QCOMPARE(spy.count(), 1); QCOMPARE(spy.takeFirst(), QList<QVariant>() << "fi" << false); - // If the delay between two key presses is larger than 5000 milliseconds, + // If the delay between two key presses is larger than the chosen timeout, // a new search is started. We add a small safety margin to avoid race conditions. - QTest::qWait(5000 + 10); + QTest::qWait(m_keyboardSearchManager.timeout() + 10); m_keyboardSearchManager.addKeys("l"); QCOMPARE(spy.count(), 1); |
