summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport
Commit message (Collapse)AuthorAgeFilesLines
* Tests: Remove declaration of built-in and automatic metatypes.Stephen Kelly2013-01-062-2/+0
| | | | | | | | These types are either built-in or 'automatically declared' and so don't need to be explicitly declared as metatypes. Change-Id: Ifd116dee32a450ff89a9a1011e26b434765d6e95 Reviewed-by: David Faure <david.faure@kdab.com>
* Only use the user set page margins for custom paperAndy Shaw2012-10-301-0/+59
| | | | | | | | | | | | | | When the QPrinter is initalized then it will set up page margins based on the default paper size. If the paper size is changed to be a custom one then it should disregard the margins for the default paper size. If the page margins are set explicitly beforehand then it will use these page margins. Change-Id: Ic535c3a80b8b217dbd5eb5f4fb2cbc0ab1354563 Reviewed-by: Titta Heikkala <titta.heikkala@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Revert a change to printer orientationTitta Heikkala2012-10-151-6/+6
| | | | | | | | | | | | | | | Reverting change: Ia6bc9ae14d79a646e61bfc97652f9f5af90738b3 The previous change does not set the printer correctly. It looks based on the tests that the correct printer is set, but in reality the default printer is used (even though printerName() is returning the printer set). Updated taskQTBUG4497_reusePrinterOnDifferentFiles() test case so that it generates PDF instead of PS. Testing the binary output can't be guaranteed to work in this case. Change-Id: Iee111f2c2dec84f86344a38816c21e191f5373ea Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* QtPrintSupport: allow slight deviations from pre-defined paper sizes in testsTeemu Katajisto2012-09-261-4/+4
| | | | | | | | | | CUPS paper sizes may differ from Qt paper sizes slightly and thus fail the strict comparison in qprinter tests. This is needed for the followup patch which initializes the cupsplugin with CUPS/PPD defaults. Change-Id: Ie66f77ead0204de0fc7c7913005fa516d57d34eb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-222-48/+48
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Test: Redo remove QSKIP from printsupport testsCaroline Chao2012-09-132-0/+38
| | | | | | | | | | | | Redoing 5704cbc462ad0b316a6b55a0f1dadc3c50762ef This can't work, because the define comes from qconfig.h, not qmake. Skipping initTestCase and cleanupTestCase when QT_NO_PRINTER is defined. Change-Id: I2527c018294b7518a4692f2c93da933848640b5d Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
* Test: remove QSKIP from printsupport testsCaroline Chao2012-09-122-45/+17
| | | | | | | | | Exclude printsupport tests from the build when QT_NO_PRINTER is defined. Change-Id: Iedae91666a599f4b77250abc8aac14c256fde34e Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Stabilize qprinter testEskil Abrahamsen Blomfeldt2012-09-121-1/+10
| | | | | | | | | | | The CreationDate entry in the two PDF files can potentially be different depending on when the test is run. We ignore the line for this entry when comparing the two results. Task-number: QTBUG-27171 Change-Id: I8978678295217edd537edb0d2c25260813aa3d93 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Avoid duplicate setPen() in PDF when reusing QPrinterEskil Abrahamsen Blomfeldt2012-09-111-3/+0
| | | | | | | | | | | | The simplePen property was not reset when reusing the QPrinter, thus we would output two identical setPen() commands in the PDF making the autotest that compares the results fail. Task-number: QTBUG-27171 Change-Id: I601042ec59e45ef72a56f230f6112a91a259b4a5 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Ensure that printer orientation is preservedTitta Heikkala2012-08-301-0/+2
| | | | | | | | | | | | | | | | | After setting the printer name the initialization is no longer done for a printer with a name. Instead doReinit() method is called to preserve the orientation (set with setOrientation() method before calling setPrinterName()). Before the orientation was changed back to default when setPrinterName() method was called ignoring the orientation set. Updated also the autotest because the case: taskQTBUG4497_reusePrinterOnDifferentFiles() is no longer expected to fail on Windows. Task-number: QTBUG-26008 Change-Id: Ia6bc9ae14d79a646e61bfc97652f9f5af90738b3 Reviewed-by: Andy Shaw Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-012-0/+2
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Replace Q_WS_ in tests by Q_OS_ or check platform names.Friedemann Kleint2012-07-161-1/+1
| | | | | Change-Id: Ica445cf1e83bfaab870ac344d6c02766f047a5cc Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Replace insignificant test with QEXPECT_FAIL.Toby Tomkins2012-07-052-2/+3
| | | | | | | Task-number: QTBUG-26430 Change-Id: I647388701b7e6a71bb011f7714ff3b96c833a837 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* QtPrintSupport - Add QPrinterInfo api for more printer detailsJohn Layt2012-05-291-1/+8
| | | | | | | | | | | | | | | A previous commit changed the Mac behaviour for printerName() from returning the CUPS Description to returning the CUPS Name. In case anyone was relying on this for a human-readable name add new api to return the CUPS Description. Also add the Location and Make and Model which will be used in the Unix print dialog instead of directly calling CUPS. Change-Id: I9901bf8d6368466adf111580f5db5a3f01ca9170 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Add CONFIG+=parallel_test to suspected parallel-safe tests.Rohan McGovern2012-05-281-0/+1
| | | | | | | | | These tests have passed a parallel stress test on all three of Linux, Mac, Windows. Mark them with CONFIG+=parallel_test to allow CI to run them in parallel, saving time. Change-Id: I19fd333c3c645a67374ca998f6c8530dd236b0f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* QtPrinterInfo: Improve QPrinterInfo TestingJohn Layt2012-05-251-163/+88
| | | | | | | | | | | | | | | | | | | Much of the current QPrinterInfo tests fail due to being dependent on specific physical or network printers being attached. This change removes all printer specific tests and replaces them with generic tests that will use whatever printers are installed. Note if no printers are installed then the tests will still pass. A later change will add virtual printers to test returned results are correct. Windows test code is also required and will come later. This does not yet remove the "insignificant" status from the test, further improvements and code fixes are still required. Change-Id: I60802445924edb126aadf78337a8cb6f2f3b3d37 Reviewed-by: John Layt <jlayt@kde.org>
* QtPrintSupport - Modify Platform Plugin QPrinterInfo apiJohn Layt2012-05-241-0/+19
| | | | | | | | | | | | | | Change the way the printsupport plugin creates QPrinterInfo objects, provide platform api to return a named printer, and expose this as static public api in QPrinterInfo. Only the Mac plugin used the old api, the other plugins will have direct support added in separate commits, but will use the default implementation for now. Change-Id: I7d6b6556eb39919cfb15bc0e814afbaf13c5712c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QtPrintSupport - Fix Mac printerName() useJohn Layt2012-05-231-15/+0
| | | | | | | | | | | | | | | | | | | | Mac in Qt4 and 5 has been using the PMPrinter Name for the QPrinter and QPrinterInfo printerName() value, but this is incorrect. This is in fact the CUPS Description field, is in human readable form and is not guaranteed to be unique. The CUPS Name field is the PMPrinter ID value and should be used as the unique identifier when accessing printers. This has worked up to now due to an undocumented feature in the OSX api that accepted the Name when the ID should be used. Changing all uses of PMPrinterGetName to PMPrinterGetID fixes this and allows the QPrinterInfo test of names to pass without munging the names. Change-Id: I25322aa1a924bed9f67f4ad5e208274c8b700e17 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Revert "QtPrintSupport: Remove remaining LPR specific code"Rohan McGovern2012-05-081-3/+0
| | | | | | | | | | | | | | | | This doesn't compile with a typical cross-compilation setup, which generally won't include cups headers. The commit should have been rejected, but wasn't, due to a bug in the Qt Project CI. Since it now causes all other modules depending on qtbase to fail their CI, it must be reverted to minimize disruption while the commit can be amended and/or the test toolchain updated to include cups headers. This reverts commit 80f7a388906f94f58bf765a32b9abbb16f967db2. Change-Id: I315ae275b37de358a74af28ab7bd691c9849acba Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* QtPrintSupport: Remove remaining LPR specific codeJohn Layt2012-05-071-0/+3
| | | | | | | | | | | | | | | | | | CUPS is the only supported print system on UNIX, LPR/PS support has already been dropped but some LPR specific code still remains. * Move qt_getCupsPrinterPaperSizes from qprinterinfo_unix to QCUPSSupport * Remove qprinterinfo_unix as no longer used * Remove LPR related code from QPdfPrintEngine * Remove all QT_NO_LPR uses * Remove most QT_NO_CUPS uses, use QT_NO_PRINTER where necessary Some QT_NO_CUPS uses remain in QPdfPrintEngine, these will be removed in a following change implementing a CUPS plugin. Change-Id: I439b6fad9cf88c3d24aa48e49475f49ad310dbad Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Re-enable QPrinterInfo test on Mac OS X.Jason McDonald2012-04-191-2/+0
| | | | | | | | | | | | | | | | | | | This test has not failed in the last 1000 CI runs on Mac. It only fails when the test machine has some printers configured, which is not presently true for the CI machines. The two options are to disable the test on all unix platforms (because it fails on all unicies when there are printers present) or to enable the test for all platforms so that CI can catch regressions that don't depend on having printers connected. I choose the latter option. If the CI machines are configured with printers before the known bug is fixed, the failures should be marked with QEXPECT_FAIL rather than disabling the whole test again. Task-number: QTBUG-23060 Change-Id: I3cebed4aefdd088ff00215ea9d7413f90bd9e9b1 Reviewed-by: John Layt <jlayt@kde.org>
* Add bug numbers to insignificant_test markers.Jason McDonald2012-04-161-1/+1
| | | | | Change-Id: I4033ef0bd50a1be484503886b6bfda456da26675 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix MSVC warnings in tests.Friedemann Kleint2012-04-021-1/+2
| | | | | | | | | - Unused variables - conversion truncations - Overflow in expressions like '-1 + sizeof()' Change-Id: Ibbd18497951e9e7e9dccaf596cb4e864b69ec02c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Windows: Make tst_qprinter significant again since the test is passingMiikka Heikkinen2012-03-311-1/+0
| | | | | | | The commit b188221fee0eaacec115b514185a0508ef655897 fixed the test. Change-Id: I630ede91ad6050b6a22d2b65947dd341ce7d9aa9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QPrinterInfo: remove a test that is too earlyThiago Macieira2012-03-241-1/+1
| | | | | | | | If we want to have any chance of getting the missing printers reported, we cannot check the size beforehand. Change-Id: I450897fe53c04aeb1a4b217bd0c1f548c455a428 Reviewed-by: John Layt <jlayt@kde.org>
* Fix QPrinter test in WindowsMiikka Heikkinen2012-03-231-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | Fixed Q_WS_WIN flagging to Q_OS_WIN in QPrinter API and related implementation to make API match the documentation and Qt 4.8. Also Removed the unused internal HDC related functions from the API, that were previously behind Q_WS_WIN flag. Some of the properties tested are documented to be valid for native print engine only in X11 environment, so skipped testing those in non-xcb environments. Copy collation is also apparently not supported in Windows native print engine, though this seems to be undocumented, so skipped that only in Windows. At least one of the test blocks in tst_QPrinter::valuePreservation() failed due to default printer not getting set properly, so fixed that, too. Task-number: QTBUG-24191 Task-number: QTBUG-22927 Change-Id: I44a5e3d647a1279fcc7f1e99de6881f9be330246 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix infinite recursion crash in QPrinterInfo::supportedPaperSizes()Miikka Heikkinen2012-03-191-1/+0
| | | | | | | | | | | | | | This function calls platform specific function QWindowsPrinterSupport::supportedPaperSizes(), which then called back to QPrinterInfo::supportedPaperSizes(), causing infinite recursion. Fixed by providing a proper implementation for querying supported paper sizes in QWin32PrintEngine - the same implementation was used in Qt 4.8. Task-number: QTBUG-24190 Change-Id: I64a2773d83596df19818bf2636f1255943d7851d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Move tst_qprinter.cpp to QtPrintSupportDebao Zhang2012-03-128-0/+1445
QPrinter and QPrinterInfo belong to QtPrintSupport. Change-Id: I0c146e0c717be365e752c1eaf7dbe6765fb72da2 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>