diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-04-13 03:06:21 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-04-13 03:06:21 (GMT) |
commit | 6a9a804919599764bb183380a1d5885c3658444f (patch) | |
tree | c832347db923931a765ada46d74161df29515742 /tests/auto/declarative/qdeclarativelanguage | |
parent | ff0020481398e7c109973949260a42711c4cdcdc (diff) | |
download | Qt-6a9a804919599764bb183380a1d5885c3658444f.zip Qt-6a9a804919599764bb183380a1d5885c3658444f.tar.gz Qt-6a9a804919599764bb183380a1d5885c3658444f.tar.bz2 |
Fix and test remote root component with qmldir-specified content.
6ed43975f6733265b8b91b00a9a212076d896ef9 was not correct fix (just invalidated the test)
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage')
3 files changed, 39 insertions, 2 deletions
diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestNamed.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestNamed.qml new file mode 100644 index 0000000..672cb8f --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestNamed.qml @@ -0,0 +1 @@ +NamedLocal { } diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir index da10ba9..60150f8 100644 --- a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir +++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir @@ -1,4 +1,5 @@ Test Test.qml TestSubDir TestSubDir.qml TestLocal TestLocal.qml +NamedLocal LocalInternal.qml internal LocalInternal LocalInternal.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index bfb56ba..c033c48 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -52,6 +52,7 @@ #include "testtypes.h" #include "../../../shared/util.h" +#include "testhttpserver.h" /* This test case covers QML language issues. This covers everything that does not @@ -116,6 +117,8 @@ private slots: void defaultPropertyListOrder(); void declaredPropertyValues(); + void basicRemote_data(); + void basicRemote(); void importsBuiltin_data(); void importsBuiltin(); void importsLocal_data(); @@ -1298,6 +1301,40 @@ void tst_qdeclarativelanguage::importsLocal() testType(qml,type,error); } +void tst_qdeclarativelanguage::basicRemote_data() +{ + QTest::addColumn<QUrl>("url"); + QTest::addColumn<QString>("type"); + QTest::addColumn<QString>("error"); + + QString serverdir = "http://127.0.0.1:14445/qtest/declarative/qmllanguage/"; + + QTest::newRow("no need for qmldir") << QUrl(serverdir+"Test.qml") << "" << ""; + QTest::newRow("need qmldir") << QUrl(serverdir+"TestLocal.qml") << "" << ""; +} + +void tst_qdeclarativelanguage::basicRemote() +{ + QFETCH(QUrl, url); + QFETCH(QString, type); + QFETCH(QString, error); + + TestHTTPServer server(14445); + server.serveDirectory(SRCDIR); + + QDeclarativeComponent component(&engine, url); + + QTRY_VERIFY(!component.isLoading()); + + if (error.isEmpty()) { + if (component.isError()) + qDebug() << component.errors(); + QVERIFY(!component.isError()); + } else { + QVERIFY(component.isError()); + } +} + void tst_qdeclarativelanguage::importsRemote_data() { QTest::addColumn<QString>("qml"); @@ -1320,8 +1357,6 @@ void tst_qdeclarativelanguage::importsRemote_data() << "UndeclaredLocal is not a type"; } -#include "testhttpserver.h" - void tst_qdeclarativelanguage::importsRemote() { QFETCH(QString, qml); |