From a1f9b2b2b0f146bf2b57814ba9d56504d90a7f5a Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 19 Jun 2013 15:33:14 +0200 Subject: Make the test a bit more sane. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unactivating a window is not really supported, nor has it ever really been, so activate another window instead. This incidentally also makes the test work cross platform. Change-Id: I6e593e9b7972dd5c5038c8d18a42be90bf19248c Reviewed-by: Jørgen Lind --- tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 3fa669c1fb..d428e2705d 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -3673,8 +3673,6 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut() void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup() { - if (m_keyboardScheme != QPlatformTheme::X11KeyboardScheme) - QSKIP("Only tested on X11"); QLineEdit le; le.setText(" "); QPalette p = le.palette(); @@ -3692,7 +3690,12 @@ void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup() QImage img(le.size(),QImage::Format_ARGB32 ); le.render(&img); QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::green).rgb()); - QApplication::setActiveWindow(0); + + QWindow window; + window.resize(100, 50); + window.show(); + window.requestActivate(); + QVERIFY(QTest::qWaitForWindowActive(&window)); le.render(&img); QCOMPARE(img.pixel(10, le.height()/2), QColor(Qt::red).rgb()); } -- cgit v1.2.3