summaryrefslogtreecommitdiffstats
path: root/tests/baseline/shared/qwidgetbaselinetest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Baseline tests: prefer a screen with a DPR of 1.0Volker Hilsheimer2024-12-101-0/+19
| | | | | | | | | | Move the windows to a screen with a 1.0 DPR, if the primary screen has a different ratio. This makes sure that we get reproducible runs also locally, no matter where e.g. the mouse pointer is (which on macOS defines which screen the window opens up). Change-Id: Iab7708c4abc0c97486f00a44a4b0a4c2b9406a62 Reviewed-by: Eirik Aavitsland <[email protected]>
* Baseline tests: disable animations in the vista styleVolker Hilsheimer2024-12-101-0/+1
| | | | | | | | | | | | | The Vista style uses a dynamic property on each objects to control animations; respect that dynamic property on the style itself as well to make it possible to turn off animations. Do so in the baseline test framework to get rid of some flakiness when using the Windows Vista style. Change-Id: I2bad329786f38e37d99f947f121e5cd44f5741c1 Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]>
* test: baseline: Call finalizeAndDisconnectJonas Karlsson2024-11-221-0/+5
| | | | | | Pick-to: 6.8 Change-Id: I4379b4b982b869ca8d502d2f102ddc3b3858b5c8 Reviewed-by: Eirik Aavitsland <[email protected]>
* Baseline tests: improve focus setting and clearingVolker Hilsheimer2024-04-171-15/+18
| | | | | | | | | | | | | | | | | Set focus on the test window so that the tested widget doesn't have it. Remove the "PublicWidget" hack, we have public QWidget APIs to find the next widget in the focus chain that we can use to transfer focus reliably. Use TabFocusReason to maintain existing behavior, and to test that widgets that handle that specifically appear correctly. Clear the focus on the test widget by setting it back to the window after taking the "focused" snapshot. Add QCOMPARE and QVERIFY to assert that the test is in the right state before taking screenshots. Pick-to: 6.7 Change-Id: Icef6ce1bb1c63c9f6cde7d0ddca82e693cace420 Reviewed-by: Axel Spoerl <[email protected]>
* Baseline testing: use a full screen background behind the test windowVolker Hilsheimer2024-04-171-2/+7
| | | | | | | | | | | | | | Some tests are flaky on macOS because the background desktop shows through the rounded corner of the test window. We cannot reliably control this on each platform, so instead make the test window a secondary window with a second, fullscreen and frameless window as the transient parent. This way, we have full control over the background pixels that might show through (semi-)transparent parts of the test window. Pick-to: 6.7 Change-Id: I44b7e834797b46fa8b44d776f6b91c99536a6cc9 Reviewed-by: Axel Spoerl <[email protected]>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <[email protected]>
* Baseline tests: wait longer before taking a screen snapshotVolker Hilsheimer2023-04-201-2/+3
| | | | | | | | | | | The recorded images frequently show traces of a fading-out command prompt window that is opened by the test execution. We evidently have to wait longer for all window-level effects are finished. Pick-to: 6.5 Change-Id: I50db54ff33bf4bb1ef7c480a4aede1d5de1618c3 Reviewed-by: Santhosh Kumar <[email protected]> Reviewed-by: Eirik Aavitsland <[email protected]>
* Update base line test case for widgetsSanthosh Kumar2023-01-061-0/+13
| | | | | | | | | | | Added baseline test case for menu (popup), combobox, command link and lcd number. New API takeScreenSnapshot() has been added for screen capture and it serves to capture pop up windows Change-Id: I5c1e46df270d94faf5c53431cddbd07532c256ee Reviewed-by: Volker Hilsheimer <[email protected]>
* Deprecate QApplication::setActiveWindow() and mark as internalTor Arne Vestbø2022-08-271-1/+3
| | | | | | | | | | | | | | The function is used the internal window activation machinery and should not be called by user code. Many tests still use this function, and should be ported over to QWidget::activateWindow(). For now they are using the private helper in QApplicationPrivate, so that we can progress with the public API deprecation. Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5 Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Baseline tests: slow down cursor blinkingVolker Hilsheimer2022-05-051-0/+4
| | | | | | | | | | | Override the default cursor blink time so that we don't get mismatches from line edits. We need to set the time to > 0 so that QStyleHints does not fall back to the platform integration. Pick-to: 6.3 Change-Id: Ib1d04f7450c01c352c13098886aee032dcb14c72 Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Eirik Aavitsland <[email protected]>
* Baseline testing of widget: wait before taking snapshotVolker Hilsheimer2022-05-051-1/+2
| | | | | | | | | | | | | | Widgets and styles might use fade effects or other asynchronous mechanisms as part of hovering. This results in mismatches when the snapshot is taken before those effects are completed. Since we can't control all such animations from the outside, process events for some milliseconds before taking the snapshot. Pick-to: 6.3 Change-Id: I771658300628238552bddcd14a6751c3f6c0c63d Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Eirik Aavitsland <[email protected]>
* Enable tests to turn off Windows Vista animationsVolker Hilsheimer2022-03-161-0/+1
| | | | | | | | | | | | | | | | Animations in that style depend on the current time, which makes it impossible to run baseline tests. Introduce a dynamic property that allows us to set the time that animations use. This way, tests can turn the animation off, or control which time should be used. To keep performance overhead low, check only once whether the dynamic property is set at all. Pick-to: 6.3 Change-Id: I9bc57b9867fb0d852e101570eca4c7609e7fe1a8 Reviewed-by: Eirik Aavitsland <[email protected]>
* Baseline: don't compensate for DPRs != 1.0Volker Hilsheimer2022-03-141-9/+7
| | | | | | | | | | | The resulting blurriness is too significant, and it's hard to see where the difference comes from. Better to encode the screen DPR into the appearance ID if it's not 1.0, and warn about the comparison not being done to the baseline images with a 1.0 DPR. Pick-to: 6.3 Change-Id: Iceab7b0a4cc50627145bd1267cff22344f7d8e5b Reviewed-by: Eirik Aavitsland <[email protected]>
* Baseline testing: make style name explicitVolker Hilsheimer2022-03-141-6/+7
| | | | | | | | | Mangling it into the checksum makes it hard to navigate the available images. Pick-to: 6.3 Change-Id: I54dcab5681e747ce1c5fe1b141ef6c4441d1f7eb Reviewed-by: Eirik Aavitsland <[email protected]>
* Prevent takeStandardSnapshots() from stopping on first mismatchAxel Spoerl2022-01-171-4/+5
| | | | | | | | | | | Force takeStandardSnapshots() to take and log all snapshots before launching QFAIL. Macros QBASELINE_CHECK_DEFERRED and QBASELINE_CHECK_DEFERRED_SUM have been added in qbaselinetest.h Task-number: QTBUG-99790 Pick-to: 6.3 Change-Id: Ia015de808f354e842ac4029c5c84be18c4a4e209 Reviewed-by: Volker Hilsheimer <[email protected]>
* Add a couple of utility functions to the baseline test frameworkEirik Aavitsland2022-01-131-1/+1
| | | | | | | | | | | | | | | | | | Adds a function for setting the baseline Project name, which selects the top level server directory and hence config settings. Also adds a function that lets the client override the server config setting for the project image keys (ItemPathKeys). This is the list of properties that will be used to determine which clients are "the same", i.e. which baseline to compare against. Overriding that is handy since it allows experimentation and customization of clients without involving changes in the project config on the baseline server. Pick-to: 6.3 6.2 Change-Id: Id3998356494a9a2cb71c009b43593d3dc1b6963a Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Axel Spoerl <[email protected]>
* Remove faulty #include from widgets baseline testEirik Aavitsland2022-01-041-2/+0
| | | | | | | | | | Since there is an actual qwidgetbaselinetest.h header file, one should not include a .moc file. The build system will take care of it, and currently warns about this #include. Pick-to: 6.3 Change-Id: I4fbff9ef75c901fe3db4df54d6f3ff0d9307edce Reviewed-by: Volker Hilsheimer <[email protected]>
* Share common code for baseline-testing widget UIsVolker Hilsheimer2021-11-261-0/+189
Setting up the baseline tests, creating an appearance identifier, and basic image-grabbing functionality doesn't need to be reinvented for each test case that wants to use baseline testing of widget UIs. As a drive-by, remove unneeded Qt 5 meta tags from .pri file. Change-Id: I1562e1b377946305cac018e0f0f0175c2c07cd31 Reviewed-by: Eirik Aavitsland <[email protected]>