summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorninerider <qt-info@nokia.com>2009-09-25 10:47:30 (GMT)
committerninerider <qt-info@nokia.com>2009-09-25 10:55:48 (GMT)
commit2bea70ee7f25462a6942dff15a21a6d5377433d3 (patch)
tree7b1f8d1794e89f06ac81faa107bf912b42bcef54 /tests/auto
parent1694e404916d1dc275da17f9cc433338e0db7714 (diff)
downloadQt-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')
-rw-r--r--tests/auto/windowsmobile/test/testQMenuBar_current.pngbin23702 -> 22964 bytes
-rw-r--r--tests/auto/windowsmobile/test/testSimpleWidget_current.pngbin22034 -> 23841 bytes
-rw-r--r--tests/auto/windowsmobile/test/tst_windowsmobile.cpp17
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
index d03e69a..f0042b8 100644
--- a/tests/auto/windowsmobile/test/testQMenuBar_current.png
+++ b/tests/auto/windowsmobile/test/testQMenuBar_current.png
Binary files differ
diff --git a/tests/auto/windowsmobile/test/testSimpleWidget_current.png b/tests/auto/windowsmobile/test/testSimpleWidget_current.png
index 09a10a3..8086c41 100644
--- a/tests/auto/windowsmobile/test/testSimpleWidget_current.png
+++ b/tests/auto/windowsmobile/test/testSimpleWidget_current.png
Binary files differ
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);
}