summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-08-12 15:18:08 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-13 00:00:46 +0200
commitbf7ca774bd81b7a0fe65f99e62cf32690da9a77d (patch)
tree5a5467d2b1ac291efa31ddc41b3622f3307a7c43 /tests
parent879e351961e4203cb0e4c62b5658bc5563b145a1 (diff)
test: fixed crash in tst_qmenubar::accel in qpa
Always verify that the application has an active window before attempting to generate a key click. This problem potentially affected all platforms, but is rare on non-qpa Linux since QTest::qWaitForWindowShown would usually avoid the problem on that platform. Change-Id: I0c30be6228361faffa121c9c2d7a667f8351ebd6 Reviewed-on: http://codereview.qt.nokia.com/2896 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index 51bb43716e..e1b7f1ff9b 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -344,6 +344,9 @@ void tst_QMenuBar::accel()
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar();
+
+ // shortcuts won't work unless the window is active
+ QTRY_VERIFY( QApplication::activeWindow() );
// QTest::keyClick( 0, Qt::Key_A, AltKey );
QTest::keyClick( 0, Qt::Key_A, Qt::ControlModifier );
QTest::qWait(300);