aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-03-02 08:25:43 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-20 03:15:43 +0100
commitab1e510121c8a679fdaca12ccd30e0f7ac12a26b (patch)
tree68c377ba468a667c43211f005ead5b49b16e49f3 /tests/auto
parentb143d3fb589e7ce7171c9975679fa47181a6a10f (diff)
Migrate gui dependencies from QtQml to QtQuick.
Ensure that users of declarative that have no need for functionality provided by the Qt Gui module do not have to link against it. Any use of QtGui functionality is delegated to providers that can be installed by another library; QtQuick adds default providers for this functionality when linked against QtQml. Task-number: QTBUG-24559 Change-Id: I5e6a58a4198732dc2f8f52f71abfa1152b871aa7 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qml.pro1
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.h1
-rw-r--r--tests/auto/qml/qqmlglobal/qqmlglobal.pro7
-rw-r--r--tests/auto/qml/qqmlglobal/tst_qqmlglobal.cpp88
-rw-r--r--tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp3
-rw-r--r--tests/auto/qml/qqmllanguage/data/wrongType.7.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/wrongType.7.qml1
-rw-r--r--tests/auto/qml/qqmlqt/qqmlqt.pro2
-rw-r--r--tests/auto/qml/qqmlqt/tst_qqmlqt.cpp2
-rw-r--r--tests/auto/qml/qqmlvaluetypes/qqmlvaluetypes.pro2
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp16
-rw-r--r--tests/auto/quick/qquickapplication/tst_qquickapplication.cpp15
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp18
13 files changed, 137 insertions, 21 deletions
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
index 4d1644f6b3..0657ea891e 100644
--- a/tests/auto/qml/qml.pro
+++ b/tests/auto/qml/qml.pro
@@ -32,6 +32,7 @@ PRIVATETESTS += \
qqmlecmascript \
qqmlcontext \
qqmlexpression \
+ qqmlglobal \
qqmlinstruction \
qqmllanguage \
qqmlproperty \
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h
index 54fab26405..ab8f85baa3 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.h
+++ b/tests/auto/qml/qqmlecmascript/testtypes.h
@@ -51,6 +51,7 @@
#include <QtGui/qmatrix.h>
#include <QtGui/qcolor.h>
#include <QtGui/qvector3d.h>
+#include <QtGui/QFont>
#include <QtGui/QPixmap>
#include <QtCore/qdatetime.h>
#include <QtQml/qjsvalue.h>
diff --git a/tests/auto/qml/qqmlglobal/qqmlglobal.pro b/tests/auto/qml/qqmlglobal/qqmlglobal.pro
new file mode 100644
index 0000000000..b39c04500c
--- /dev/null
+++ b/tests/auto/qml/qqmlglobal/qqmlglobal.pro
@@ -0,0 +1,7 @@
+CONFIG += testcase
+TARGET = tst_qqmlglobal
+SOURCES += tst_qqmlglobal.cpp
+macx:CONFIG -= app_bundle
+
+CONFIG += parallel_test
+QT += qml-private testlib
diff --git a/tests/auto/qml/qqmlglobal/tst_qqmlglobal.cpp b/tests/auto/qml/qqmlglobal/tst_qqmlglobal.cpp
new file mode 100644
index 0000000000..e2cdd50883
--- /dev/null
+++ b/tests/auto/qml/qqmlglobal/tst_qqmlglobal.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <qqml.h>
+
+#include <private/qqmlglobal_p.h>
+
+class tst_qqmlglobal : public QObject
+{
+ Q_OBJECT
+public:
+ tst_qqmlglobal() {}
+
+private slots:
+ void initTestCase();
+
+ void valueTypeProviderWarning();
+ void colorProviderWarning();
+ void guiProviderWarning();
+};
+
+void tst_qqmlglobal::initTestCase()
+{
+}
+
+void tst_qqmlglobal::valueTypeProviderWarning()
+{
+ const QLatin1String expected("Warning: QQml_valueTypeProvider: no value type provider has been set! ");
+ QTest::ignoreMessage(QtWarningMsg, expected.data());
+ QQml_valueTypeProvider();
+}
+
+void tst_qqmlglobal::colorProviderWarning()
+{
+ const QLatin1String expected("Warning: QQml_colorProvider: no color provider has been set! ");
+ QTest::ignoreMessage(QtWarningMsg, expected.data());
+ QQml_colorProvider();
+}
+
+void tst_qqmlglobal::guiProviderWarning()
+{
+ const QLatin1String expected("Warning: QQml_guiProvider: no GUI provider has been set! ");
+ QTest::ignoreMessage(QtWarningMsg, expected.data());
+ QQml_guiProvider();
+}
+
+QTEST_MAIN(tst_qqmlglobal)
+
+#include "tst_qqmlglobal.moc"
diff --git a/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp b/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp
index d076f038d3..d0e818f076 100644
--- a/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp
+++ b/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp
@@ -42,6 +42,9 @@
#include <qtest.h>
#include <private/qqmlcompiler_p.h>
+#include <QVector3D>
+#include <QVector4D>
+
class tst_qqmlinstruction : public QObject
{
Q_OBJECT
diff --git a/tests/auto/qml/qqmllanguage/data/wrongType.7.errors.txt b/tests/auto/qml/qqmllanguage/data/wrongType.7.errors.txt
index 614346bd2b..8a168d2941 100644
--- a/tests/auto/qml/qqmllanguage/data/wrongType.7.errors.txt
+++ b/tests/auto/qml/qqmllanguage/data/wrongType.7.errors.txt
@@ -1 +1 @@
-3:20:Invalid property assignment: color expected
+4:20:Invalid property assignment: color expected
diff --git a/tests/auto/qml/qqmllanguage/data/wrongType.7.qml b/tests/auto/qml/qqmllanguage/data/wrongType.7.qml
index ddc3835199..e9dd71079a 100644
--- a/tests/auto/qml/qqmllanguage/data/wrongType.7.qml
+++ b/tests/auto/qml/qqmllanguage/data/wrongType.7.qml
@@ -1,4 +1,5 @@
import Test 1.0
+import QtQuick 2.0
MyTypeObject {
colorProperty: 12
}
diff --git a/tests/auto/qml/qqmlqt/qqmlqt.pro b/tests/auto/qml/qqmlqt/qqmlqt.pro
index 92fabf5882..012f58ae70 100644
--- a/tests/auto/qml/qqmlqt/qqmlqt.pro
+++ b/tests/auto/qml/qqmlqt/qqmlqt.pro
@@ -10,4 +10,4 @@ TESTDATA = data/*
CONFIG += parallel_test
-QT += core-private gui-private v8-private qml-private quick-private testlib
+QT += core-private v8-private qml-private quick-private testlib gui
diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
index d3dc3e7343..a1d7291565 100644
--- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
+++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
@@ -52,6 +52,8 @@
#include <QCryptographicHash>
#include <QtQuick/QQuickItem>
#include <QSignalSpy>
+#include <QVector3D>
+#include <QVector4D>
#include "../../shared/util.h"
class tst_qqmlqt : public QQmlDataTest
diff --git a/tests/auto/qml/qqmlvaluetypes/qqmlvaluetypes.pro b/tests/auto/qml/qqmlvaluetypes/qqmlvaluetypes.pro
index 9155cbee96..8d9acb65b3 100644
--- a/tests/auto/qml/qqmlvaluetypes/qqmlvaluetypes.pro
+++ b/tests/auto/qml/qqmlvaluetypes/qqmlvaluetypes.pro
@@ -13,4 +13,4 @@ TESTDATA = data/*
CONFIG += parallel_test
-QT += core-private gui-private v8-private qml-private testlib
+QT += core-private gui-private v8-private qml-private quick-private gui testlib
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
index 54791fc340..359653caa4 100644
--- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
@@ -43,12 +43,12 @@
#include <QQmlEngine>
#include <QQmlComponent>
#include <QDebug>
-#include <private/qqmlvaluetype_p.h>
+#include <private/qquickvaluetypes_p.h>
#include "../../shared/util.h"
#include "testtypes.h"
QT_BEGIN_NAMESPACE
-extern int qt_defaultDpi();
+extern int qt_defaultDpi(void);
QT_END_NAMESPACE
class tst_qqmlvaluetypes : public QQmlDataTest
@@ -1129,13 +1129,13 @@ void tst_qqmlvaluetypes::cppClasses()
CPP_TEST(QQmlSizeFValueType, QSizeF(-100.7, 18.2));
CPP_TEST(QQmlRectValueType, QRect(13, 39, 10928, 88));
CPP_TEST(QQmlRectFValueType, QRectF(88.2, -90.1, 103.2, 118));
- CPP_TEST(QQmlVector2DValueType, QVector2D(19.7, 1002));
- CPP_TEST(QQmlVector3DValueType, QVector3D(18.2, 19.7, 1002));
- CPP_TEST(QQmlVector4DValueType, QVector4D(18.2, 19.7, 1002, 54));
- CPP_TEST(QQmlQuaternionValueType, QQuaternion(18.2, 19.7, 1002, 54));
- CPP_TEST(QQmlMatrix4x4ValueType,
+ CPP_TEST(QQuickVector2DValueType, QVector2D(19.7, 1002));
+ CPP_TEST(QQuickVector3DValueType, QVector3D(18.2, 19.7, 1002));
+ CPP_TEST(QQuickVector4DValueType, QVector4D(18.2, 19.7, 1002, 54));
+ CPP_TEST(QQuickQuaternionValueType, QQuaternion(18.2, 19.7, 1002, 54));
+ CPP_TEST(QQuickMatrix4x4ValueType,
QMatrix4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16));
- CPP_TEST(QQmlFontValueType, QFont("Helvetica"));
+ CPP_TEST(QQuickFontValueType, QFont("Helvetica"));
}
diff --git a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
index 61675d980d..4dd7688f6a 100644
--- a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
+++ b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
@@ -69,7 +69,15 @@ tst_qquickapplication::tst_qquickapplication()
void tst_qquickapplication::active()
{
QQmlComponent component(&engine);
- component.setData("import QtQuick 2.0; Item { property bool active: Qt.application.active }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.0; "
+ "Item { "
+ " property bool active: Qt.application.active; "
+ " property bool active2: false; "
+ " Connections { "
+ " target: Qt.application; "
+ " onActiveChanged: active2 = Qt.application.active; "
+ " } "
+ "}", QUrl::fromLocalFile(""));
QQuickItem *item = qobject_cast<QQuickItem *>(component.create());
QVERIFY(item);
QQuickView view;
@@ -77,6 +85,7 @@ void tst_qquickapplication::active()
// not active
QVERIFY(!item->property("active").toBool());
+ QVERIFY(!item->property("active2").toBool());
QCOMPARE(item->property("active").toBool(), QGuiApplication::activeWindow() != 0);
// active
@@ -86,6 +95,7 @@ void tst_qquickapplication::active()
QEXPECT_FAIL("", "QTBUG-21573", Abort);
QTRY_COMPARE(view.status(), QQuickView::Ready);
QCOMPARE(item->property("active").toBool(), QGuiApplication::activeWindow() != 0);
+ QCOMPARE(item->property("active2").toBool(), QGuiApplication::activeWindow() != 0);
#if 0
// QGuiApplication has no equivalent of setActiveWindow(0). QTBUG-21573
@@ -128,6 +138,9 @@ void tst_qquickapplication::layoutDirection()
void tst_qquickapplication::inputPanel()
{
+ const QLatin1String expected("Qt.application.inputPanel is deprecated, use Qt.inputMethod instead ");
+ QTest::ignoreMessage(QtWarningMsg, expected.data());
+
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Item { property variant inputPanel: Qt.application.inputPanel }", QUrl::fromLocalFile(""));
QQuickItem *item = qobject_cast<QQuickItem *>(component.create());
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 92e8528a0d..77f0ec190d 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -45,7 +45,7 @@
#include <QtQml/qqmlcomponent.h>
#include <QtQuick/private/qquicktext_p.h>
#include <private/qquicktext_p_p.h>
-#include <private/qqmlvaluetype_p.h>
+#include <private/qquickvaluetypes_p.h>
#include <QFontMetrics>
#include <qmath.h>
#include <QtQuick/QQuickView>
@@ -93,7 +93,7 @@ private slots:
void color();
void smooth();
- // QQmlFontValueType
+ // QQuickFontValueType
void weight();
void underline();
void overline();
@@ -1119,7 +1119,7 @@ void tst_qquicktext::weight()
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
- QCOMPARE((int)textObject->font().weight(), (int)QQmlFontValueType::Normal);
+ QCOMPARE((int)textObject->font().weight(), (int)QQuickFontValueType::Normal);
delete textObject;
}
@@ -1130,7 +1130,7 @@ void tst_qquicktext::weight()
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
- QCOMPARE((int)textObject->font().weight(), (int)QQmlFontValueType::Bold);
+ QCOMPARE((int)textObject->font().weight(), (int)QQuickFontValueType::Bold);
delete textObject;
}
@@ -1223,7 +1223,7 @@ void tst_qquicktext::capitalization()
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
- QCOMPARE((int)textObject->font().capitalization(), (int)QQmlFontValueType::MixedCase);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QQuickFontValueType::MixedCase);
delete textObject;
}
@@ -1234,7 +1234,7 @@ void tst_qquicktext::capitalization()
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
- QCOMPARE((int)textObject->font().capitalization(), (int)QQmlFontValueType::AllUppercase);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QQuickFontValueType::AllUppercase);
delete textObject;
}
@@ -1245,7 +1245,7 @@ void tst_qquicktext::capitalization()
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
- QCOMPARE((int)textObject->font().capitalization(), (int)QQmlFontValueType::AllLowercase);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QQuickFontValueType::AllLowercase);
delete textObject;
}
@@ -1256,7 +1256,7 @@ void tst_qquicktext::capitalization()
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
- QCOMPARE((int)textObject->font().capitalization(), (int)QQmlFontValueType::SmallCaps);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QQuickFontValueType::SmallCaps);
delete textObject;
}
@@ -1267,7 +1267,7 @@ void tst_qquicktext::capitalization()
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
- QCOMPARE((int)textObject->font().capitalization(), (int)QQmlFontValueType::Capitalize);
+ QCOMPARE((int)textObject->font().capitalization(), (int)QQuickFontValueType::Capitalize);
delete textObject;
}