diff options
author | Michael Bruning <michael.bruning@theqtcompany.com> | 2016-02-25 13:40:01 +0100 |
---|---|---|
committer | Michael BrĂ¼ning <michael.bruning@theqtcompany.com> | 2016-03-16 21:21:41 +0000 |
commit | df222f8ccb2151e519b92d3d2046ee74f221902e (patch) | |
tree | de0e9af4a11878399698e383f0162feee48d0aa6 /tests/auto/quick/qquickwebengineview | |
parent | ec9a8753a7b17bbbf886c155ed884c581c547913 (diff) |
Add callback to printing API
Also corrects and updates the printToPDF docs to reflect recent changes.
Change-Id: Iffe276a1046d6d55923939f9d72b97cd533017ff
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick/qquickwebengineview')
-rw-r--r-- | tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index 4430bdae0..f2f5b31f9 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -60,7 +60,7 @@ private Q_SLOTS: void inputMethod(); void inputMethodHints(); void basicRenderingSanity(); - void printToPDF(); + void printToPdf(); private: inline QQuickWebEngineView *newWebEngineView(); @@ -462,7 +462,7 @@ void tst_QQuickWebEngineView::inputMethodHints() #endif } -void tst_QQuickWebEngineView::printToPDF() +void tst_QQuickWebEngineView::printToPdf() { QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX"); QVERIFY(tempDir.isValid()); @@ -471,9 +471,18 @@ void tst_QQuickWebEngineView::printToPDF() QVERIFY(waitForLoadSucceeded(view)); QString path = tempDir.path() + "/print_success.pdf"; - view->printToPDF(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait); + view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait); QTest::qWait(500); QVERIFY(QFile::exists(path)); + +#if !defined(Q_OS_WIN) + path = tempDir.path() + "/print_//fail.pdf"; +#else + path = tempDir.path() + "/print_|fail.pdf"; +#endif // #if !defined(Q_OS_WIN) + view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait); + QTest::qWait(500); + QVERIFY(!QFile::exists(path)); } QTEST_MAIN(tst_QQuickWebEngineView) |