summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmenubar/tst_qmenubar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmenubar/tst_qmenubar.cpp')
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index cc26742d10..7ccb225941 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -119,18 +119,24 @@ private slots:
void removeItem();
void count();
void insertItem_QString_QObject();
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void accel();
void activatedCount();
+#endif
void allowActiveAndDisabled();
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void check_accelKeys();
void check_cursorKeys1();
void check_cursorKeys2();
void check_cursorKeys3();
+#endif
void check_homeKey();
void check_endKey();
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void check_escKey();
+#endif
// void check_mouse1_data();
// void check_mouse1();
@@ -138,12 +144,16 @@ private slots:
// void check_mouse2();
void check_altPress();
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void check_shortcutPress();
void check_menuPosition();
+#endif
void task223138_triggered();
void task256322_highlight();
void menubarSizeHint();
+#ifndef Q_WS_MAC
void taskQTBUG4965_escapeEaten();
+#endif
void taskQTBUG11823_crashwithInvisibleActions();
protected slots:
@@ -333,12 +343,10 @@ void tst_QMenuBar::onActivated( QAction* action )
// printf( QString("acceleratorId: %1, count: %1\n").arg( i ).arg(activated_count) );
}
+// On Mac/WinCE, native key events are needed to test menu action activation.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::accel()
{
-#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
-
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar();
@@ -350,12 +358,12 @@ void tst_QMenuBar::accel()
QCOMPARE( last_accel_id, action );
}
+#endif
+// On Mac/WinCE, native key events are needed to test menu action activation.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::activatedCount()
{
-#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
// create a popup menu with menu items set the accelerators later...
initSimpleMenubar();
@@ -363,6 +371,7 @@ void tst_QMenuBar::activatedCount()
//wait(5000);
QCOMPARE( activated_count, 2 ); //1 from the popupmenu and 1 from the menubar
}
+#endif
void tst_QMenuBar::clear()
{
@@ -565,11 +574,10 @@ void tst_QMenuBar::insertItem_QString_QObject()
QVERIFY(actions.size() < 4); // there is no menu 4!
}
+// On Mac/WinCE, native key events are needed to test menu action activation.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_accelKeys()
{
-#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
initComplexMenubar();
// start with a bogus key that shouldn't trigger anything
@@ -633,13 +641,12 @@ void tst_QMenuBar::check_accelKeys()
QCOMPARE(item2_C->selCount(), 1u);
QCOMPARE(item2_D->selCount(), 1u);
}
+#endif
+// Qt/Mac,WinCE does not use the native popups/menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_cursorKeys1()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
// start with a ALT + 1 that activates the first popupmenu
@@ -664,13 +671,12 @@ void tst_QMenuBar::check_cursorKeys1()
QCOMPARE(item2_C->selCount(), 0u);
QCOMPARE(item2_D->selCount(), 0u);
}
+#endif
+// Qt/Mac,WinCE does not use the native popups/menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_cursorKeys2()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
// select popupmenu2
@@ -691,16 +697,15 @@ void tst_QMenuBar::check_cursorKeys2()
QCOMPARE(item2_C->selCount(), 0u);
QCOMPARE(item2_D->selCount(), 1u);
}
+#endif
/*!
If a popupmenu is active you can use Left to move to the menu to the left of it.
+ Qt/Mac,WinCE does not use the native popups/menubar.
*/
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_cursorKeys3()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
// select Popupmenu 2
@@ -719,6 +724,7 @@ void tst_QMenuBar::check_cursorKeys3()
QCOMPARE(item2_C->selCount(), 0u);
QCOMPARE(item2_D->selCount(), 0u);
}
+#endif
/*!
If a popupmenu is active you can use home to go quickly to the first item in the menu.
@@ -799,12 +805,10 @@ void tst_QMenuBar::check_endKey()
If Down is pressed next the popup is activated again.
*/
+// Qt/Mac,WinCE does not use the native popups/menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_escKey()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
QVERIFY( !pm1->isActiveWindow() );
@@ -833,7 +837,7 @@ void tst_QMenuBar::check_escKey()
// Let's see if the correct slot is called...
QVERIFY2( item2_C->selCount() == 1, "Expected item 2C to be selected" );
}
-
+#endif
// void tst_QMenuBar::check_mouse1_data()
// {
@@ -1002,12 +1006,10 @@ void tst_QMenuBar::check_altPress()
QVERIFY( ::qobject_cast<QMenuBar *>(qApp->focusWidget()) );
}
+// Qt/Mac,WinCE does not use the native popups/menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_shortcutPress()
{
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
- QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
-#endif
-
initComplexMenubar();
qApp->setActiveWindow(mw);
@@ -1022,15 +1024,13 @@ void tst_QMenuBar::check_shortcutPress()
QTest::keyClick(mb, Qt::Key_2);
QVERIFY(pm1->isActiveWindow());
}
+#endif
+// Qt/Mac does not use the native popups/menubar.
+// Qt/CE uses native menubar.
+#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
void tst_QMenuBar::check_menuPosition()
{
-#ifdef Q_WS_MAC
- QSKIP("Qt/Mac does not use the native popups/menubar", SkipAll);
-#endif
-#ifdef Q_OS_WINCE_WM
- QSKIP("Qt/CE uses native menubar", SkipAll);
-#endif
Menu menu;
initComplexMenubar();
menu.setTitle("&menu");
@@ -1095,8 +1095,8 @@ void tst_QMenuBar::check_menuPosition()
menu.close();
qApp->setLayoutDirection(dir);
}
-
}
+#endif
void tst_QMenuBar::task223138_triggered()
{
@@ -1237,11 +1237,10 @@ void tst_QMenuBar::menubarSizeHint()
QCOMPARE(resSize, mb.sizeHint());
}
+// On Mac, do not test the menubar with escape key.
+#ifndef Q_WS_MAC
void tst_QMenuBar::taskQTBUG4965_escapeEaten()
{
-#ifdef Q_WS_MAC
- QSKIP("On Mac, do not test the menubar with escape key", SkipAll);
-#endif
QMenuBar menubar;
QMenu menu("menu1");
QAction *first = menubar.addMenu(&menu);
@@ -1261,6 +1260,7 @@ void tst_QMenuBar::taskQTBUG4965_escapeEaten()
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Escape); //now the action should be triggered
QTRY_VERIFY(!menubar.isVisible());
}
+#endif
void tst_QMenuBar::taskQTBUG11823_crashwithInvisibleActions()
{