summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativelanguage
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativelanguage')
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/TestNamed.qml1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp39
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);