diff options
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r-- | tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp | 11 | ||||
-rw-r--r-- | tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp | 17 |
2 files changed, 11 insertions, 17 deletions
diff --git a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp index d83e4729ef..06491f96ab 100644 --- a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp +++ b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp @@ -144,13 +144,10 @@ void tst_QColorDialog::postKeyReturn() { void tst_QColorDialog::testGetRgba() { -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "Sending QTest::keyClick to OSX color dialog helper fails, see QTBUG-24320", Continue); -#endif - bool ok = false; - QTimer::singleShot(500, this, SLOT(postKeyReturn())); - QColorDialog::getRgba(0xffffffff, &ok); - QVERIFY(ok); + QColorDialog cd; + cd.show(); + QTimer::singleShot(0, this, SLOT(postKeyReturn())); + QTRY_COMPARE(cd.result(), int(QDialog::Accepted)); } void tst_QColorDialog::defaultOkButton() diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp index 1762e40a9d..ae70adf94b 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp +++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp @@ -64,7 +64,7 @@ public: public slots: void postKeyReturn(); - void testGetFont(); + void testDefaultOkButton(); void testSetFont(); public slots: @@ -116,15 +116,12 @@ void tst_QFontDialog::postKeyReturn() { } } -void tst_QFontDialog::testGetFont() +void tst_QFontDialog::testDefaultOkButton() { -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "Sending QTest::keyClick to OSX font dialog helper fails, see QTBUG-24321", Continue); -#endif - bool ok = false; - QTimer::singleShot(2000, this, SLOT(postKeyReturn())); - QFontDialog::getFont(&ok); - QVERIFY(ok); + QFontDialog fd; + fd.show(); + QTimer::singleShot(0, this, SLOT(postKeyReturn())); + QTRY_COMPARE(fd.result(), int(QDialog::Accepted)); } void tst_QFontDialog::runSlotWithFailsafeTimer(const char *member) @@ -144,7 +141,7 @@ void tst_QFontDialog::runSlotWithFailsafeTimer(const char *member) void tst_QFontDialog::defaultOkButton() { - runSlotWithFailsafeTimer(SLOT(testGetFont())); + runSlotWithFailsafeTimer(SLOT(testDefaultOkButton())); } void tst_QFontDialog::testSetFont() |