From 1bb05bf5230ac41c47ce09fcc1e85e26db150322 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 9 Feb 2010 10:30:06 +0100 Subject: Stabilize QLineEdit test on X11 --- tests/auto/qlineedit/tst_qlineedit.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 69e7699..ca84b38 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -3455,10 +3455,8 @@ void tst_QLineEdit::task210502_caseInsensitiveInlineCompletion() completer.setCompletionMode(QCompleter::InlineCompletion); lineEdit.setCompleter(&completer); lineEdit.show(); -#ifdef Q_WS_X11 - // to be safe and avoid failing setFocus with window managers - qt_x11_wait_for_window_manager(&lineEdit); -#endif + QTest::qWaitForWindowShown(&lineEdit); + QApplication::setActiveWindow(&lineEdit); lineEdit.setFocus(); QTRY_VERIFY(lineEdit.hasFocus()); QTest::keyPress(&lineEdit, 'a'); @@ -3651,10 +3649,11 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut() le.addAction(&action); le.show(); - QApplication::setActiveWindow(&le); QTest::qWaitForWindowShown(&le); + QApplication::setActiveWindow(&le); le.setFocus(); QTRY_VERIFY(le.hasFocus()); + QTest::keyClick(0, Qt::Key_P); QCOMPARE(spy.count(), 1); } -- cgit v0.12