summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-04-03 13:41:41 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2018-04-09 05:59:39 +0000
commitb49a2e671a6c01bec0f0140a81f5501074ec8856 (patch)
tree00716fab0661fd94c2c1d53562fccc79a09be670
parenta9d903d18f668a6827149f82816caf96ac6365a2 (diff)
tst_QPrinter: Use qWaitForWindowActive() to wait for dialog
Instead of an unconditional wait. The QSKIP is necessary because the PDF format is non-native and the Windows implementation of QPrintDialog doesn't work then. The macOS implementation has the same warning, so add the check for that OS as well. The test has previously passed, since it hasn't seen not actually opening the dialog as an issue. Change-Id: Ib53e378b232580358f13e0c5206404412f9e6ee2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index 88bae686ab..f68cf5c59c 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -592,10 +592,14 @@ void tst_QPrinter::printDialogCompleter()
{
QPrintDialog dialog;
dialog.printer()->setOutputFileName(testPdfFileName(QLatin1String("file")));
+#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN)
+ if (dialog.printer()->outputFormat() != QPrinter::NativeFormat)
+ QSKIP("Dialog cannot be used with non-native formats");
+#endif
dialog.setEnabledOptions(QAbstractPrintDialog::PrintToFile);
dialog.show();
- QTest::qWait(100);
+ QVERIFY(QTest::qWaitForWindowActive(&dialog));
QTest::keyClick(&dialog, Qt::Key_Tab);
QTest::keyClick(&dialog, 'P');