diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-07-26 11:52:06 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-07-26 11:52:32 +0200 |
commit | 993bc84f49b4922480f6ec566f31c24465f0e005 (patch) | |
tree | 5189edc8e2e0942459d09a4765ad17dd681fe801 /tests/auto/qml | |
parent | 713a4c5b1d601f57d538fdbb1e8f6bc05ce07275 (diff) | |
parent | 84871192077c18bb093c6259339200bd22d64f00 (diff) |
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into merge
Change-Id: I5824a3eb624b325de10acfd5109c4c1bdabcf780
Diffstat (limited to 'tests/auto/qml')
12 files changed, 62 insertions, 39 deletions
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp index b1f92e3f34..e0c20307a8 100644 --- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp +++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp @@ -83,9 +83,9 @@ void tst_qqmlcontext::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_qqmlcontext::resolvedUrl() @@ -93,18 +93,18 @@ void tst_qqmlcontext::resolvedUrl() // Relative to the component { QQmlContext 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 { QQmlContext ctxt(&engine); - ctxt.setBaseUrl(QUrl("http://www.nokia.com/")); + ctxt.setBaseUrl(QUrl("http://www.qt-project.org/")); QQmlContext 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 @@ -116,10 +116,10 @@ void tst_qqmlcontext::resolvedUrl() // Relative to a deleted parent { QQmlContext *ctxt = new QQmlContext(&engine); - ctxt->setBaseUrl(QUrl("http://www.nokia.com/")); + ctxt->setBaseUrl(QUrl("http://www.qt-project.org/")); QQmlContext 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; @@ -130,7 +130,7 @@ void tst_qqmlcontext::resolvedUrl() { QQmlContext 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/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index d604118b58..4d06665cb3 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -241,8 +241,8 @@ void tst_qqmlengine::offlineStoragePath() // Without these set, QDesktopServices::storageLocation returns // strings with extra "//" at the end. We set them to ignore this problem. qApp->setApplicationName("tst_qqmlengine"); - qApp->setOrganizationName("Nokia"); - qApp->setOrganizationDomain("nokia.com"); + qApp->setOrganizationName("QtProject"); + qApp->setOrganizationDomain("www.qt-project.org"); QQmlEngine engine; diff --git a/tests/auto/qml/qqmlerror/tst_qqmlerror.cpp b/tests/auto/qml/qqmlerror/tst_qqmlerror.cpp index 6f24210823..44fbb0a982 100644 --- a/tests/auto/qml/qqmlerror/tst_qqmlerror.cpp +++ b/tests/auto/qml/qqmlerror/tst_qqmlerror.cpp @@ -64,18 +64,18 @@ void tst_qqmlerror::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")); QQmlError 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_qqmlerror::description() @@ -142,28 +142,28 @@ void tst_qqmlerror::toString() { { QQmlError 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")); } { QQmlError 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_qqmlerror::copy() { QQmlError 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); @@ -172,22 +172,22 @@ void tst_qqmlerror::copy() QQmlError 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); @@ -198,12 +198,12 @@ void tst_qqmlerror::debug() { { QQmlError 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/qml/qqmlinfo/tst_qqmlinfo.cpp b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp index c0fb13c932..7a964a1fcb 100644 --- a/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp +++ b/tests/auto/qml/qqmlinfo/tst_qqmlinfo.cpp @@ -179,8 +179,8 @@ void tst_qqmlinfo::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"); @@ -202,14 +202,14 @@ void tst_qqmlinfo::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\" true Quick "); + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: false 1.1 1.2 15 hello 'b' QUrl(\"http://www.qt-project.org\") World \"Qt\" true 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") << bool(true) diff --git a/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp b/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp index 7a59a7f243..44ab690f68 100644 --- a/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp +++ b/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp @@ -158,7 +158,7 @@ void tst_qqmlinstruction::dump() } { - data->urls << QUrl("http://www.nokia.com"); + data->urls << QUrl("http://www.qt-project.org"); QQmlCompiledData::Instruction::StoreUrl i; i.propertyIndex = 8; i.value = data->urls.count() - 1; @@ -501,7 +501,7 @@ void tst_qqmlinstruction::dump() << "8\t\tSTORE_INTEGER\t\t5\t9" << "9\t\tSTORE_BOOL\t\t6\ttrue" << "10\t\tSTORE_STRING\t\t7\t1\t\t\"Test String\"" - << "11\t\tSTORE_URL\t\t8\t0\t\tQUrl(\"http://www.nokia.com\") " + << "11\t\tSTORE_URL\t\t8\t0\t\tQUrl(\"http://www.qt-project.org\") " << "12\t\tSTORE_COLOR\t\t9\t\t\t\"ff00ff00\"" << "13\t\tSTORE_DATE\t\t10\t9" << "14\t\tSTORE_TIME\t\t11" diff --git a/tests/auto/qml/qqmllanguage/data/DeepComponent.qml b/tests/auto/qml/qqmllanguage/data/DeepComponent.qml new file mode 100644 index 0000000000..893c358dbe --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/DeepComponent.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 +Item { + property alias someObject: text + Text { + id: text + } +} diff --git a/tests/auto/qml/qqmllanguage/data/deepProperty.qml b/tests/auto/qml/qqmllanguage/data/deepProperty.qml new file mode 100644 index 0000000000..b3c7f68640 --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/deepProperty.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 +DeepComponent { + someObject.font.family: "test" +} diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 29c4463471..852034cbde 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -48,6 +48,7 @@ #include <QtCore/qfileinfo.h> #include <QtCore/qdir.h> #include <QSignalSpy> +#include <QFont> #include <private/qqmlproperty_p.h> #include <private/qqmlmetatype_p.h> @@ -190,6 +191,8 @@ private slots: void scopedProperties(); + void deepProperty(); + private: QQmlEngine engine; QStringList defaultImportPathList; @@ -3149,6 +3152,15 @@ void tst_qqmllanguage::scopedProperties() QVERIFY(o->property("success").toBool()); } +void tst_qqmllanguage::deepProperty() +{ + QQmlComponent component(&engine, testFile("deepProperty.qml")); + QScopedPointer<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")); +} + // Tests that the implicit import has lowest precedence, in the case where // there are conflicting types and types only found in the local import. // Tests that just check one (or the root) type are in ::importsOrder diff --git a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp index e52e4792a9..9d8fad8eb2 100644 --- a/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp +++ b/tests/auto/qml/qqmlsqldatabase/tst_qqmlsqldatabase.cpp @@ -62,8 +62,8 @@ public: tst_qqmlsqldatabase() { qApp->setApplicationName("tst_qqmlsqldatabase"); - qApp->setOrganizationName("Nokia"); - qApp->setOrganizationDomain("nokia.com"); + qApp->setOrganizationName("QtProject"); + qApp->setOrganizationDomain("www.qt-project.org"); engine = new QQmlEngine; } diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/open_arg_count.2.qml b/tests/auto/qml/qqmlxmlhttprequest/data/open_arg_count.2.qml index 677759ccf3..9a4e76bb6a 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/data/open_arg_count.2.qml +++ b/tests/auto/qml/qqmlxmlhttprequest/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/qml/qqmlxmlhttprequest/data/open_invalid_method.qml b/tests/auto/qml/qqmlxmlhttprequest/data/open_invalid_method.qml index 0f29031e42..09ba1b5581 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/data/open_invalid_method.qml +++ b/tests/auto/qml/qqmlxmlhttprequest/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/qml/qqmlxmlhttprequest/data/open_sync.qml b/tests/auto/qml/qqmlxmlhttprequest/data/open_sync.qml index eafdda761f..0f31c966fa 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/data/open_sync.qml +++ b/tests/auto/qml/qqmlxmlhttprequest/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; |