diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-28 10:57:34 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-28 14:29:59 +0200 |
commit | 94db5de2acefb6e96d4f6cfda2df14905a5e63c5 (patch) | |
tree | c361f5dd4989ee0743e2a9f94b64dbb2127e5dea /tests/auto/qml/qqmlecmascript | |
parent | 11f67b80c4eab4b1e3eb8e6b1e8b69e7a60e42a9 (diff) | |
parent | dee67b41b031791c7b6313e935e622ef8d594686 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
tests/auto/quick/qquicktext/tst_qquicktext.cpp
Change-Id: I075e742da8396a268d97d3ab34bcd9e0c0cf001f
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
5 files changed, 21 insertions, 13 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/include_remote.js b/tests/auto/qml/qqmlecmascript/data/include_remote.js index 4331cb79d0..4b5e153736 100644 --- a/tests/auto/qml/qqmlecmascript/data/include_remote.js +++ b/tests/auto/qml/qqmlecmascript/data/include_remote.js @@ -1,8 +1,8 @@ var myvar = 10; -function go() +function go(serverBaseUrl) { - var a = Qt.include("http://127.0.0.1:8111/remote_file.js", + var a = Qt.include(serverBaseUrl + "/remote_file.js", function(o) { test2 = o.status == o.OK test3 = a.status == a.OK @@ -13,7 +13,7 @@ function go() test1 = a.status == a.LOADING - var b = Qt.include("http://127.0.0.1:8111/exception.js", + var b = Qt.include(serverBaseUrl + "/exception.js", function(o) { test7 = o.status == o.EXCEPTION test8 = b.status == a.EXCEPTION diff --git a/tests/auto/qml/qqmlecmascript/data/include_remote.qml b/tests/auto/qml/qqmlecmascript/data/include_remote.qml index fe020a55df..7742b621a9 100644 --- a/tests/auto/qml/qqmlecmascript/data/include_remote.qml +++ b/tests/auto/qml/qqmlecmascript/data/include_remote.qml @@ -17,5 +17,7 @@ QtObject { property bool test9: false property bool test10: false - Component.onCompleted: IncludeTest.go(); + property string serverBaseUrl; + + Component.onCompleted: IncludeTest.go(serverBaseUrl); } diff --git a/tests/auto/qml/qqmlecmascript/data/include_remote_missing.js b/tests/auto/qml/qqmlecmascript/data/include_remote_missing.js index 27dd63badf..5ebc1aadf0 100644 --- a/tests/auto/qml/qqmlecmascript/data/include_remote_missing.js +++ b/tests/auto/qml/qqmlecmascript/data/include_remote_missing.js @@ -1,6 +1,6 @@ -function go() +function go(serverBaseUrl) { - var a = Qt.include("http://127.0.0.1:8111/missing.js", + var a = Qt.include(serverBaseUrl + "/missing.js", function(o) { test2 = o.status == o.NETWORK_ERROR test3 = a.status == a.NETWORK_ERROR diff --git a/tests/auto/qml/qqmlecmascript/data/include_remote_missing.qml b/tests/auto/qml/qqmlecmascript/data/include_remote_missing.qml index e8ef609fed..eb75bd676f 100644 --- a/tests/auto/qml/qqmlecmascript/data/include_remote_missing.qml +++ b/tests/auto/qml/qqmlecmascript/data/include_remote_missing.qml @@ -8,5 +8,7 @@ QtObject { property bool test2: false property bool test3: false - Component.onCompleted: IncludeTest.go(); + property string serverBaseUrl; + + Component.onCompleted: IncludeTest.go(serverBaseUrl); } diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index def04765a0..eb25eb70f4 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -4203,12 +4203,12 @@ void tst_qqmlecmascript::importScripts() QFETCH(QVariantList, propertyValues); TestHTTPServer server; - QVERIFY2(server.listen(8111), qPrintable(server.errorString())); + QVERIFY2(server.listen(), qPrintable(server.errorString())); server.serveDirectory(dataDirectory() + "/remote"); QStringList importPathList = engine.importPathList(); - QString remotePath(QLatin1String("http://127.0.0.1:8111/")); + QString remotePath(server.urlString("/")); engine.addImportPath(remotePath); QQmlComponent component(&engine, testfile); @@ -6055,12 +6055,14 @@ void tst_qqmlecmascript::include() // Remote - error { TestHTTPServer server; - QVERIFY2(server.listen(8111), qPrintable(server.errorString())); + QVERIFY2(server.listen(), qPrintable(server.errorString())); server.serveDirectory(dataDirectory()); QQmlComponent component(&engine, testFileUrl("include_remote_missing.qml")); - QObject *o = component.create(); + QObject *o = component.beginCreate(engine.rootContext()); QVERIFY(o != 0); + o->setProperty("serverBaseUrl", server.baseUrl().toString()); + component.completeCreate(); QTRY_VERIFY(o->property("done").toBool() == true); @@ -6097,12 +6099,14 @@ void tst_qqmlecmascript::includeRemoteSuccess() // Remote - success TestHTTPServer server; - QVERIFY2(server.listen(8111), qPrintable(server.errorString())); + QVERIFY2(server.listen(), qPrintable(server.errorString())); server.serveDirectory(dataDirectory()); QQmlComponent component(&engine, testFileUrl("include_remote.qml")); - QObject *o = component.create(); + QObject *o = component.beginCreate(engine.rootContext()); QVERIFY(o != 0); + o->setProperty("serverBaseUrl", server.baseUrl().toString()); + component.completeCreate(); QTRY_VERIFY(o->property("done").toBool() == true); QTRY_VERIFY(o->property("done2").toBool() == true); |