summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r--tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro3
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp6
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro7
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp15
4 files changed, 12 insertions, 19 deletions
diff --git a/tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro b/tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro
index 730932d83d..b4cf05e347 100644
--- a/tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro
+++ b/tests/auto/widgets/dialogs/qerrormessage/qerrormessage.pro
@@ -1,10 +1,7 @@
CONFIG += testcase
TEMPLATE = app
TARGET = tst_qerrormessage
-DEPENDPATH += .
-INCLUDEPATH += .
QT += widgets testlib
-# Input
SOURCES += tst_qerrormessage.cpp
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index 7ab3100cab..4a6f714a7c 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -489,6 +489,9 @@ void tst_QFileDialog2::task227304_proxyOnFileDialog()
void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior()
{
+#ifdef Q_OS_MAC
+ QSKIP("This test currently fails on Mac OS X, see QTBUG-23602");
+#endif
QDir current = QDir::currentPath();
current.mkdir("test");
current.cd("test");
@@ -515,9 +518,6 @@ void tst_QFileDialog2::task227930_correctNavigationKeyboardBehavior()
QTest::keyClick(list, Qt::Key_Down);
QTest::keyClick(list, Qt::Key_Return);
QTest::qWait(200);
-#ifdef Q_OS_MAC
- QEXPECT_FAIL("", "This test currently fails on Mac OS X, see QTBUG-23602", Continue);
-#endif
QCOMPARE(fd.isVisible(), true);
QTest::qWait(200);
file.close();
diff --git a/tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro b/tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro
index f25ed650c3..91848fee24 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro
+++ b/tests/auto/widgets/dialogs/qmessagebox/qmessagebox.pro
@@ -1,9 +1,6 @@
-CONFIG += testcase
TEMPLATE = app
TARGET = tst_qmessagebox
-QT += widgets testlib
-DEPENDPATH += .
-INCLUDEPATH += .
+QT += gui-private core-private widgets testlib
+CONFIG += testcase
-# Input
SOURCES += tst_qmessagebox.cpp
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index 7fc752488d..1d391a1c09 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -48,6 +48,8 @@
#include <QApplication>
#include <QPushButton>
#include <QDialogButtonBox>
+#include <QPlatformTheme>
+#include <private/qguiapplication_p.h>
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
#include <QMacStyle>
#endif
@@ -407,15 +409,12 @@ void tst_QMessageBox::staticSourceCompat()
sendKeySoon();
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No);
int expectedButton = int(QMessageBox::Yes);
-#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
- if (qobject_cast<QMacStyle *>(qApp->style()))
- expectedButton = int(QMessageBox::No);
-#elif !defined(QT_NO_STYLE_CLEANLOOKS)
- if (qobject_cast<QCleanlooksStyle *>(qApp->style())) {
- QEXPECT_FAIL("", "Special handling of QMessageBox::information buttons for Cleanlooks not implemented yet, QTBUG-24315", Continue);
- expectedButton = int(QMessageBox::No);
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
+ const int dialogButtonBoxLayout = theme->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt();
+ if (dialogButtonBoxLayout == QDialogButtonBox::MacLayout
+ || dialogButtonBoxLayout == QDialogButtonBox::GnomeLayout)
+ expectedButton = int(QMessageBox::No);
}
-#endif
QCOMPARE(ret, expectedButton);
QCOMPARE(keyToSend, -1);