From bf7ca774bd81b7a0fe65f99e62cf32690da9a77d Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 12 Aug 2011 15:18:08 +1000 Subject: 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 Reviewed-by: Kalle Lehtonen --- tests/auto/qmenubar/tst_qmenubar.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') 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); -- cgit v1.2.3