diff options
author | ninerider <qt-info@nokia.com> | 2009-09-25 10:47:30 (GMT) |
---|---|---|
committer | ninerider <qt-info@nokia.com> | 2009-09-25 10:55:48 (GMT) |
commit | 2bea70ee7f25462a6942dff15a21a6d5377433d3 (patch) | |
tree | 7b1f8d1794e89f06ac81faa107bf912b42bcef54 /tests/auto/windowsmobile | |
parent | 1694e404916d1dc275da17f9cc433338e0db7714 (diff) | |
download | Qt-2bea70ee7f25462a6942dff15a21a6d5377433d3.zip Qt-2bea70ee7f25462a6942dff15a21a6d5377433d3.tar.gz Qt-2bea70ee7f25462a6942dff15a21a6d5377433d3.tar.bz2 |
Fixed the image comparison tests for Windows Mobile 5
The image comparison reference snapshots were not up to date. Also
the comparison ignores the title bar completely.
Reviewed-by: banana joe
Diffstat (limited to 'tests/auto/windowsmobile')
-rw-r--r-- | tests/auto/windowsmobile/test/testQMenuBar_current.png | bin | 23702 -> 22964 bytes | |||
-rw-r--r-- | tests/auto/windowsmobile/test/testSimpleWidget_current.png | bin | 22034 -> 23841 bytes | |||
-rw-r--r-- | tests/auto/windowsmobile/test/tst_windowsmobile.cpp | 17 |
3 files changed, 14 insertions, 3 deletions
diff --git a/tests/auto/windowsmobile/test/testQMenuBar_current.png b/tests/auto/windowsmobile/test/testQMenuBar_current.png Binary files differindex d03e69a..f0042b8 100644 --- a/tests/auto/windowsmobile/test/testQMenuBar_current.png +++ b/tests/auto/windowsmobile/test/testQMenuBar_current.png diff --git a/tests/auto/windowsmobile/test/testSimpleWidget_current.png b/tests/auto/windowsmobile/test/testSimpleWidget_current.png Binary files differindex 09a10a3..8086c41 100644 --- a/tests/auto/windowsmobile/test/testSimpleWidget_current.png +++ b/tests/auto/windowsmobile/test/testSimpleWidget_current.png diff --git a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp index 2d7c9ea..7a86a51 100644 --- a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp +++ b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp @@ -57,6 +57,8 @@ class tst_WindowsMobile : public QObject public: tst_WindowsMobile() { + qApp->setCursorFlashTime (24 * 3600 * 1000); // once a day + // qApp->setCursorFlashTime (INT_MAX); #ifdef Q_OS_WINCE_WM q_initDD(); #endif @@ -123,11 +125,20 @@ void compareScreenshots(const QString &image1, const QString &image2) QImage screenShot(image1); QImage original(image2); - //ignore the clock + // cut away the title bar before comparing + QDesktopWidget desktop; + QRect desktopFrameRect = desktop.frameGeometry(); + QRect desktopClientRect = desktop.availableGeometry(); + QPainter p1(&screenShot); QPainter p2(&original); - p1.fillRect(310, 6, 400, 34, Qt::black); - p2.fillRect(310, 6, 400, 34, Qt::black); + + //screenShot.save("scr1.png", "PNG"); + p1.fillRect(0, 0, desktopFrameRect.width(), desktopClientRect.y(), Qt::black); + p2.fillRect(0, 0, desktopFrameRect.width(), desktopClientRect.y(), Qt::black); + + //screenShot.save("scr2.png", "PNG"); + //original.save("orig1.png", "PNG"); QVERIFY(original == screenShot); } |