summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmenubar
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-05-30 13:22:06 +0300
committerSami Merila <sami.merila@nokia.com>2011-05-30 13:22:06 +0300
commita9c76a7403b573ebe69d324d0b2f16f367c3a458 (patch)
tree904fb5c683ab60b0940df86b656ec197f54fe455 /tests/auto/qmenubar
parentf32377e2038369cbf2822875cd8836b1f70feb6e (diff)
Fix QMenuBar autotest failures for Symbian
Effectively three fixes to reach same autotest results as on other Symbian devices and to make the case not crash (itself, or Qt). a) Fix null pointer usage in QWidget. This is mostly theoretic case, since it requires that previous focus widget has widget, yet it doesn't have internal winId. Still test case manages to make this happen, so lets prevent the null pointer use. b) Skip activatedCount_noQt3() test case, since it would require shortcut support and leads to test crash. Qt for Symbian should have shortcut support as a result of task http://bugreports.qt.nokia.com/browse/QTBUG-5730 c) Ensure that menu has at least 360 width in tests that send keypresses to the menu. Otherwise, menuitems might get set into menu extension, which makes highlight tests fail (since item is not visible). Task-number: QT-5053 Reviewed-by: Tomi Vihria
Diffstat (limited to 'tests/auto/qmenubar')
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index 72048d9a00..d548a51a33 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -515,6 +515,10 @@ void tst_QMenuBar::activatedCount_noQt3()
#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll);
#endif
+#ifdef Q_OS_SYMBIAN
+ QSKIP("On Symbian OS, native key events are needed to test menu action activation", SkipAll);
+#endif
+
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar_noQt3();
@@ -1573,6 +1577,12 @@ void tst_QMenuBar::task256322_highlight()
file2->setText("file2");
QAction *nothing = win.menuBar()->addAction("nothing");
+#ifdef Q_WS_S60
+ // Set minimum width to ensure that menu items are not added to the menu extension.
+ // Minimum width 360 is the minimal screen width in any supported Symbian device.
+ win.menuBar()->setMinimumWidth(360);
+#endif
+
win.show();
QTest::qWait(200);