summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-06-19 15:33:14 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-01 08:57:52 +0200
commita1f9b2b2b0f146bf2b57814ba9d56504d90a7f5a (patch)
treee421696038edc03cabbcfaac115c2619bf8d4347 /tests
parent9f763d2fbe00425fc622bd6c5087acbca9fd3c90 (diff)
Make the test a bit more sane.
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 <jorgen.lind@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp9
1 files changed, 6 insertions, 3 deletions
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());
}