summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-07-23 11:15:17 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-07-23 11:15:18 +0200
commite3b5fcca3826d917076c2d4ab349598dd5799048 (patch)
tree584ea8df9821d62ca70cd5fedee5b364f0512117 /tests/auto/declarative
parent7353ed45c65d21444e9f22b7a45179c77e334568 (diff)
parente0f7b22341339b77aafa9150b0d79e320e9e4180 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp18
-rw-r--r--tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp34
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp8
-rw-r--r--tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/DeepComponent.qml7
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/deepProperty.qml4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml2
13 files changed, 63 insertions, 40 deletions
diff --git a/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp b/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp
index 025e0567..57d5f545 100644
--- a/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp
+++ b/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp
@@ -73,9 +73,9 @@ void tst_qdeclarativecontext::baseUrl()
QCOMPARE(ctxt.baseUrl(), QUrl());
- ctxt.setBaseUrl(QUrl("http://www.nokia.com/"));
+ ctxt.setBaseUrl(QUrl("http://www.qt-project.org/"));
- QCOMPARE(ctxt.baseUrl(), QUrl("http://www.nokia.com/"));
+ QCOMPARE(ctxt.baseUrl(), QUrl("http://www.qt-project.org/"));
}
void tst_qdeclarativecontext::resolvedUrl()
@@ -83,18 +83,18 @@ void tst_qdeclarativecontext::resolvedUrl()
// Relative to the component
{
QDeclarativeContext ctxt(&engine);
- ctxt.setBaseUrl(QUrl("http://www.nokia.com/"));
+ ctxt.setBaseUrl(QUrl("http://www.qt-project.org/"));
- QCOMPARE(ctxt.resolvedUrl(QUrl("main.qml")), QUrl("http://www.nokia.com/main.qml"));
+ QCOMPARE(ctxt.resolvedUrl(QUrl("main.qml")), QUrl("http://www.qt-project.org/main.qml"));
}
// Relative to a parent
{
QDeclarativeContext ctxt(&engine);
- ctxt.setBaseUrl(QUrl("http://www.nokia.com/"));
+ ctxt.setBaseUrl(QUrl("http://www.qt-project.org/"));
QDeclarativeContext ctxt2(&ctxt);
- QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl("http://www.nokia.com/main2.qml"));
+ QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl("http://www.qt-project.org/main2.qml"));
}
// Relative to the engine
@@ -106,10 +106,10 @@ void tst_qdeclarativecontext::resolvedUrl()
// Relative to a deleted parent
{
QDeclarativeContext *ctxt = new QDeclarativeContext(&engine);
- ctxt->setBaseUrl(QUrl("http://www.nokia.com/"));
+ ctxt->setBaseUrl(QUrl("http://www.qt-project.org/"));
QDeclarativeContext ctxt2(ctxt);
- QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl("http://www.nokia.com/main2.qml"));
+ QCOMPARE(ctxt2.resolvedUrl(QUrl("main2.qml")), QUrl("http://www.qt-project.org/main2.qml"));
delete ctxt; ctxt = 0;
@@ -120,7 +120,7 @@ void tst_qdeclarativecontext::resolvedUrl()
{
QDeclarativeContext ctxt(&engine);
- QCOMPARE(ctxt.resolvedUrl(QUrl("http://www.nokia.com/main2.qml")), QUrl("http://www.nokia.com/main2.qml"));
+ QCOMPARE(ctxt.resolvedUrl(QUrl("http://www.qt-project.org/main2.qml")), QUrl("http://www.qt-project.org/main2.qml"));
QCOMPARE(ctxt.resolvedUrl(QUrl("file:///main2.qml")), QUrl("file:///main2.qml"));
}
}
diff --git a/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp b/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp
index f67cecdc..ec0d5a75 100644
--- a/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp
+++ b/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp
@@ -172,8 +172,8 @@ void tst_qdeclarativeengine::offlineStoragePath()
// Without these set, QDesktopServices::storageLocation returns
// strings with extra "//" at the end. We set them to ignore this problem.
qApp->setApplicationName("tst_qdeclarativeengine");
- qApp->setOrganizationName("Nokia");
- qApp->setOrganizationDomain("nokia.com");
+ qApp->setOrganizationName("QtProject");
+ qApp->setOrganizationDomain("www.qt-project.org");
QDeclarativeEngine engine;
diff --git a/tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp b/tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp
index 05bf3ca5..45b29deb 100644
--- a/tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp
+++ b/tests/auto/declarative/qdeclarativeerror/tst_qdeclarativeerror.cpp
@@ -63,18 +63,18 @@ void tst_qdeclarativeerror::url()
QCOMPARE(error.url(), QUrl());
- error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setUrl(QUrl("http://www.qt-project.org/main.qml"));
- QCOMPARE(error.url(), QUrl("http://www.nokia.com/main.qml"));
+ QCOMPARE(error.url(), QUrl("http://www.qt-project.org/main.qml"));
QDeclarativeError error2 = error;
- QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml"));
+ QCOMPARE(error2.url(), QUrl("http://www.qt-project.org/main.qml"));
- error.setUrl(QUrl("http://qt.nokia.com/main.qml"));
+ error.setUrl(QUrl("http://www.qt-project.org/main.qml"));
- QCOMPARE(error.url(), QUrl("http://qt.nokia.com/main.qml"));
- QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml"));
+ QCOMPARE(error.url(), QUrl("http://www.qt-project.org/main.qml"));
+ QCOMPARE(error2.url(), QUrl("http://www.qt-project.org/main.qml"));
}
void tst_qdeclarativeerror::description()
@@ -141,28 +141,28 @@ void tst_qdeclarativeerror::toString()
{
{
QDeclarativeError error;
- error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setUrl(QUrl("http://www.qt-project.org/main.qml"));
error.setDescription("An Error");
error.setLine(92);
error.setColumn(13);
- QCOMPARE(error.toString(), QString("http://www.nokia.com/main.qml:92:13: An Error"));
+ QCOMPARE(error.toString(), QString("http://www.qt-project.org/main.qml:92:13: An Error"));
}
{
QDeclarativeError error;
- error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setUrl(QUrl("http://www.qt-project.org/main.qml"));
error.setDescription("An Error");
error.setLine(92);
- QCOMPARE(error.toString(), QString("http://www.nokia.com/main.qml:92: An Error"));
+ QCOMPARE(error.toString(), QString("http://www.qt-project.org/main.qml:92: An Error"));
}
}
void tst_qdeclarativeerror::copy()
{
QDeclarativeError error;
- error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setUrl(QUrl("http://www.qt-project.org/main.qml"));
error.setDescription("An Error");
error.setLine(92);
error.setColumn(13);
@@ -171,22 +171,22 @@ void tst_qdeclarativeerror::copy()
QDeclarativeError error3;
error3 = error;
- error.setUrl(QUrl("http://qt.nokia.com/main.qml"));
+ error.setUrl(QUrl("http://www.qt-project.org/main.qml"));
error.setDescription("Another Error");
error.setLine(2);
error.setColumn(33);
- QCOMPARE(error.url(), QUrl("http://qt.nokia.com/main.qml"));
+ QCOMPARE(error.url(), QUrl("http://www.qt-project.org/main.qml"));
QCOMPARE(error.description(), QString("Another Error"));
QCOMPARE(error.line(), 2);
QCOMPARE(error.column(), 33);
- QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml"));
+ QCOMPARE(error2.url(), QUrl("http://www.qt-project.org/main.qml"));
QCOMPARE(error2.description(), QString("An Error"));
QCOMPARE(error2.line(), 92);
QCOMPARE(error2.column(), 13);
- QCOMPARE(error3.url(), QUrl("http://www.nokia.com/main.qml"));
+ QCOMPARE(error3.url(), QUrl("http://www.qt-project.org/main.qml"));
QCOMPARE(error3.description(), QString("An Error"));
QCOMPARE(error3.line(), 92);
QCOMPARE(error3.column(), 13);
@@ -197,12 +197,12 @@ void tst_qdeclarativeerror::debug()
{
{
QDeclarativeError error;
- error.setUrl(QUrl("http://www.nokia.com/main.qml"));
+ error.setUrl(QUrl("http://www.qt-project.org/main.qml"));
error.setDescription("An Error");
error.setLine(92);
error.setColumn(13);
- QTest::ignoreMessage(QtWarningMsg, "http://www.nokia.com/main.qml:92:13: An Error ");
+ QTest::ignoreMessage(QtWarningMsg, "http://www.qt-project.org/main.qml:92:13: An Error ");
qWarning() << error;
}
diff --git a/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp b/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp
index 35cceb59..5c7a4989 100644
--- a/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp
+++ b/tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp
@@ -154,8 +154,8 @@ void tst_qdeclarativeinfo::types()
//### do we actually want QUrl to show up in the output?
//### why the extra space at the end?
- QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QUrl(\"http://qt.nokia.com\") ");
- qmlInfo(0) << QUrl("http://qt.nokia.com");
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QUrl(\"http://www.qt-project.org\") ");
+ qmlInfo(0) << QUrl("http://www.qt-project.org");
//### should this be quoted?
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: hello");
@@ -177,14 +177,14 @@ void tst_qdeclarativeinfo::chaining()
//### should more of these be automatically inserting spaces?
QString str("Hello World");
QStringRef ref(&str, 6, 5);
- QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: false 1.1 1.2 15 hello 'b' QUrl(\"http://qt.nokia.com\") World \"Qt\" Quick ");
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: false 1.1 1.2 15 hello 'b' QUrl(\"http://www.qt-project.org\") World \"Qt\" Quick ");
qmlInfo(0) << false << ' '
<< 1.1 << ' '
<< 1.2f << ' '
<< 15 << ' '
<< QLatin1String("hello") << ' '
<< QChar('b') << ' '
- << QUrl("http://qt.nokia.com")
+ << QUrl("http://www.qt-project.org")
<< ref
<< QByteArray("Qt")
<< QString ("Quick");
diff --git a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
index 0f45d463..9f458805 100644
--- a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
+++ b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
@@ -176,7 +176,7 @@ void tst_qdeclarativeinstruction::dump()
}
{
- data->urls << QUrl("http://www.nokia.com");
+ data->urls << QUrl("http://www.qt-project.org");
QDeclarativeInstruction i;
i.line = 11;
i.type = QDeclarativeInstruction::StoreUrl;
@@ -544,7 +544,7 @@ void tst_qdeclarativeinstruction::dump()
<< "8\t\t8\tSTORE_INTEGER\t\t5\t9"
<< "9\t\t9\tSTORE_BOOL\t\t6\ttrue"
<< "10\t\t10\tSTORE_STRING\t\t7\t1\t\t\"Test String\""
- << "11\t\t11\tSTORE_URL\t\t8\t0\t\tQUrl(\"http://www.nokia.com\") "
+ << "11\t\t11\tSTORE_URL\t\t8\t0\t\tQUrl(\"http://www.qt-project.org\") "
<< "12\t\t12\tSTORE_COLOR\t\t9\t\t\t\"ff00ff00\""
<< "13\t\t13\tSTORE_DATE\t\t10\t9"
<< "14\t\t14\tSTORE_TIME\t\t11\t33"
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/DeepComponent.qml b/tests/auto/declarative/qdeclarativelanguage/data/DeepComponent.qml
new file mode 100644
index 00000000..55753def
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/DeepComponent.qml
@@ -0,0 +1,7 @@
+import QtQuick 1.1
+Item {
+ property alias someObject: text
+ Text {
+ id: text
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/deepProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/deepProperty.qml
new file mode 100644
index 00000000..0787bded
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/deepProperty.qml
@@ -0,0 +1,4 @@
+import QtQuick 1.1
+DeepComponent {
+ someObject.font.family: "test"
+}
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index 1574aa4a..8052f5fc 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -162,6 +162,8 @@ private slots:
void compatibilitySemicolon();
+ void deepProperty();
+
private:
QDeclarativeEngine engine;
void testType(const QString& qml, const QString& type, const QString& error);
@@ -2059,6 +2061,16 @@ void tst_qdeclarativelanguage::implicitImportsLast()
QCOMPARE(QString(object2->metaObject()->className()), QLatin1String("QDeclarativeRectangle"));
}
+void tst_qdeclarativelanguage::deepProperty()
+{
+ QDeclarativeComponent component(&engine, testFileUrl("deepProperty.qml"));
+ VERIFY_ERRORS(0);
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QFont font = qvariant_cast<QFont>(qvariant_cast<QObject*>(o->property("someObject"))->property("font"));
+ QCOMPARE(font.family(), QStringLiteral("test"));
+}
+
QTEST_MAIN(tst_qdeclarativelanguage)
#include "tst_qdeclarativelanguage.moc"
diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
index 49eab51e..e27c95e5 100644
--- a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
+++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
@@ -173,7 +173,7 @@ void tst_qdeclarativemetatype::copy()
QT_COPY_TEST(QTime, ct);
QDateTime cdt = QDateTime::currentDateTime();
QT_COPY_TEST(QDateTime, cdt);
- QT_COPY_TEST(QUrl, QUrl("http://www.nokia.com"));
+ QT_COPY_TEST(QUrl, QUrl("http://www.qt-project.org"));
QT_COPY_TEST(QLocale, QLocale(QLocale::English, QLocale::Australia));
QT_COPY_TEST(QRect, QRect(-10, 10, 102, 99));
QT_COPY_TEST(QRectF, QRectF(-10.2, 1.2, 102, 99.6));
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 5c7fc9bc..7f05cc53 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -1101,7 +1101,7 @@ public slots:
void tst_qdeclarativetext::clickLink()
{
{
- QString componentStr = "import QtQuick 1.0\nText { text: \"<a href=\\\"http://qt.nokia.com\\\">Hello world!</a>\" }";
+ QString componentStr = "import QtQuick 1.0\nText { text: \"<a href=\\\"http://www.qt-project.org\\\">Hello world!</a>\" }";
QDeclarativeComponent textComponent(&engine);
textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
@@ -1125,7 +1125,7 @@ void tst_qdeclarativetext::clickLink()
static_cast<EventSender*>(static_cast<QGraphicsItem*>(textObject))->sendEvent(&me);
}
- QCOMPARE(test.link, QLatin1String("http://qt.nokia.com"));
+ QCOMPARE(test.link, QLatin1String("http://www.qt-project.org"));
}
}
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml
index f0032927..aaea9ebe 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_arg_count.2.qml
@@ -7,7 +7,7 @@ QtObject {
var x = new XMLHttpRequest;
try {
- x.open("GET", "http://www.nokia.com", true, "user", "password", "extra");
+ x.open("GET", "http://www.qt-project.org", true, "user", "password", "extra");
} catch (e) {
if (e.code == DOMException.SYNTAX_ERR)
exceptionThrown = true;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml
index b87823d5..197317b7 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_invalid_method.qml
@@ -7,7 +7,7 @@ QtObject {
var x = new XMLHttpRequest;
try {
- x.open("BLAH", "http://www.nokia.com");
+ x.open("BLAH", "http://www.qt-project.org");
} catch (e) {
if (e.code == DOMException.SYNTAX_ERR)
exceptionThrown = true;
diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml
index 9f8f3098..06c388a3 100644
--- a/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml
+++ b/tests/auto/declarative/qdeclarativexmlhttprequest/data/open_sync.qml
@@ -7,7 +7,7 @@ QtObject {
var x = new XMLHttpRequest;
try {
- x.open("GET", "http://www.nokia.com", false);
+ x.open("GET", "http://www.qt-project.org", false);
} catch (e) {
if (e.code == DOMException.NOT_SUPPORTED_ERR)
exceptionThrown = true;