summaryrefslogtreecommitdiffstats
path: root/tests/auto/windowsmobile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/windowsmobile')
-rw-r--r--tests/auto/windowsmobile/test/ddhelper.cpp40
-rw-r--r--tests/auto/windowsmobile/test/ddhelper.h41
-rw-r--r--tests/auto/windowsmobile/test/test.pro2
-rw-r--r--tests/auto/windowsmobile/test/testQMenuBar_current.pngbin23702 -> 22964 bytes
-rw-r--r--tests/auto/windowsmobile/test/testSimpleWidget_current.pngbin21940 -> 23841 bytes
-rw-r--r--tests/auto/windowsmobile/test/tst_windowsmobile.cpp61
-rw-r--r--tests/auto/windowsmobile/testQMenuBar/main.cpp43
-rw-r--r--tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro3
8 files changed, 163 insertions, 27 deletions
diff --git a/tests/auto/windowsmobile/test/ddhelper.cpp b/tests/auto/windowsmobile/test/ddhelper.cpp
index 5955cd39a..42b2f35cf 100644
--- a/tests/auto/windowsmobile/test/ddhelper.cpp
+++ b/tests/auto/windowsmobile/test/ddhelper.cpp
@@ -1,3 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#ifdef Q_OS_WINCE_WM
diff --git a/tests/auto/windowsmobile/test/ddhelper.h b/tests/auto/windowsmobile/test/ddhelper.h
index 3dfa9e681..049c6d6ed 100644
--- a/tests/auto/windowsmobile/test/ddhelper.h
+++ b/tests/auto/windowsmobile/test/ddhelper.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef __DDHELPER__
#define __DDHELPER__
diff --git a/tests/auto/windowsmobile/test/test.pro b/tests/auto/windowsmobile/test/test.pro
index b7f65a98e..61e275dec 100644
--- a/tests/auto/windowsmobile/test/test.pro
+++ b/tests/auto/windowsmobile/test/test.pro
@@ -5,7 +5,7 @@ HEADERS += ddhelper.h
SOURCES += tst_windowsmobile.cpp ddhelper.cpp
RESOURCES += windowsmobile.qrc
-TARGET = tst_windowsmobile
+TARGET = ../tst_windowsmobile
wincewm*: {
addFiles.sources = $$OUT_PWD/../testQMenuBar/*.exe
diff --git a/tests/auto/windowsmobile/test/testQMenuBar_current.png b/tests/auto/windowsmobile/test/testQMenuBar_current.png
index d03e69ad0..f0042b8fe 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 5cbc2bb31..8086c41ce 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 73ea0a6af..7a86a51eb 100644
--- a/tests/auto/windowsmobile/test/tst_windowsmobile.cpp
+++ b/tests/auto/windowsmobile/test/tst_windowsmobile.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
@@ -9,8 +10,8 @@
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** contained in the Technology Preview License Agreement accompanying
+** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -20,21 +21,20 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -46,7 +46,7 @@
#include <QtGui>
#ifdef Q_OS_WINCE_WM
#include <windows.h>
-#include <ddhelper.h>
+#include "ddhelper.h"
#endif
@@ -57,19 +57,21 @@ 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
}
-#ifdef Q_OS_WINCE_WM
+#if defined(Q_OS_WINCE_WM) && defined(_WIN32_WCE) && _WIN32_WCE <= 0x501
private slots:
void testMainWindowAndMenuBar();
void testSimpleWidget();
#endif
};
-#ifdef Q_OS_WINCE_WM
+#if defined(Q_OS_WINCE_WM) && defined(_WIN32_WCE) && _WIN32_WCE <= 0x501
bool qt_wince_is_platform(const QString &platformString) {
wchar_t tszPlatform[64];
@@ -120,16 +122,23 @@ void openMenu()
void compareScreenshots(const QString &image1, const QString &image2)
{
- if (qt_wince_is_smartphone())
- QSKIP("This test is only for Windows Mobile", SkipAll);
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);
}
@@ -145,6 +154,9 @@ void takeScreenShot(const QString filename)
void tst_WindowsMobile::testMainWindowAndMenuBar()
{
+ if (qt_wince_is_smartphone())
+ QSKIP("This test is only for Windows Mobile", SkipAll);
+
QProcess process;
process.start("testQMenuBar.exe");
QCOMPARE(process.state(), QProcess::Running);
@@ -158,6 +170,9 @@ void tst_WindowsMobile::testMainWindowAndMenuBar()
void tst_WindowsMobile::testSimpleWidget()
{
+ if (qt_wince_is_smartphone())
+ QSKIP("This test is only for Windows Mobile", SkipAll);
+
QMenuBar menubar;
menubar.show();
QWidget maximized;
diff --git a/tests/auto/windowsmobile/testQMenuBar/main.cpp b/tests/auto/windowsmobile/testQMenuBar/main.cpp
index 4a3b3b242..db43e6db6 100644
--- a/tests/auto/windowsmobile/testQMenuBar/main.cpp
+++ b/tests/auto/windowsmobile/testQMenuBar/main.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include <QtTest/QtTest>
#include <QtCore/QDate>
#include <QtCore/QDebug>
@@ -7,8 +48,6 @@
int main(int argc, char * argv[])
{
- int widgetNum = 20;
-
QList<QWidget*> widgets;
QApplication app(argc, argv);
diff --git a/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro b/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro
index 6dd288b46..87986e4d9 100644
--- a/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro
+++ b/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro
@@ -1,2 +1,3 @@
SOURCES += main.cpp
-DESTDIR = ./
+TARGET = ../testQMenuBar
+