aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickloader
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-07-03 14:00:25 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-05 07:14:07 +0200
commit94a519372021708febd890d0cfe5c4be70948970 (patch)
treeaa90cbc3e6c7adb7677ef2a251d37005a1c15029 /tests/auto/quick/qquickloader
parent2edefe36773db0cbe837c33f65d0cde577ccb67a (diff)
Use unique port numbers for http servers in auto tests.
Prevents conflicts when tests are run in parallel. Change-Id: Ic1652d963da291c7c41b31e2621874824fa575cb Reviewed-by: Damian Jansen <damian.jansen@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickloader')
-rw-r--r--tests/auto/quick/qquickloader/data/initialPropertyValues.8.qml2
-rw-r--r--tests/auto/quick/qquickloader/tst_qquickloader.cpp11
2 files changed, 7 insertions, 6 deletions
diff --git a/tests/auto/quick/qquickloader/data/initialPropertyValues.8.qml b/tests/auto/quick/qquickloader/data/initialPropertyValues.8.qml
index 79e9264d4a..fff67f361e 100644
--- a/tests/auto/quick/qquickloader/data/initialPropertyValues.8.qml
+++ b/tests/auto/quick/qquickloader/data/initialPropertyValues.8.qml
@@ -14,7 +14,7 @@ Item {
}
Component.onCompleted: {
- loader.setSource("http://127.0.0.1:14450/InitialPropertyValuesComponent.qml", {"canary": 6});
+ loader.setSource("http://127.0.0.1:14458/InitialPropertyValuesComponent.qml", {"canary": 6});
loader.active = true;
}
}
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
index dc21af89d7..fa09779f73 100644
--- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp
+++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
@@ -49,7 +49,8 @@
#include "testhttpserver.h"
#include "../../shared/util.h"
-#define SERVER_PORT 14450
+#define SERVER_PORT 14458
+#define SERVER_ADDR "http://localhost:14458"
class PeriodicIncubationController : public QObject,
public QQmlIncubationController
@@ -431,7 +432,7 @@ void tst_QQuickLoader::networkRequestUrl()
server.serveDirectory(dataDirectory());
QQmlComponent component(&engine);
- component.setData(QByteArray("import QtQuick 2.0\nLoader { property int signalCount : 0; source: \"http://127.0.0.1:14450/Rect120x60.qml\"; onLoaded: signalCount += 1 }"), testFileUrl("../dummy.qml"));
+ component.setData(QByteArray("import QtQuick 2.0\nLoader { property int signalCount : 0; source: \"" SERVER_ADDR "/Rect120x60.qml\"; onLoaded: signalCount += 1 }"), testFileUrl("../dummy.qml"));
if (component.isError())
qDebug() << component.errors();
QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create());
@@ -457,7 +458,7 @@ void tst_QQuickLoader::networkComponent()
QQmlComponent component(&engine);
component.setData(QByteArray(
"import QtQuick 2.0\n"
- "import \"http://127.0.0.1:14450/\" as NW\n"
+ "import \"" SERVER_ADDR "/\" as NW\n"
"Item {\n"
" Component { id: comp; NW.Rect120x60 {} }\n"
" Loader { sourceComponent: comp } }")
@@ -484,10 +485,10 @@ void tst_QQuickLoader::failNetworkRequest()
QVERIFY(server.isValid());
server.serveDirectory(dataDirectory());
- QTest::ignoreMessage(QtWarningMsg, "http://127.0.0.1:14450/IDontExist.qml: File not found");
+ QTest::ignoreMessage(QtWarningMsg, SERVER_ADDR "/IDontExist.qml: File not found");
QQmlComponent component(&engine);
- component.setData(QByteArray("import QtQuick 2.0\nLoader { property int did_load: 123; source: \"http://127.0.0.1:14450/IDontExist.qml\"; onLoaded: did_load=456 }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml"));
+ component.setData(QByteArray("import QtQuick 2.0\nLoader { property int did_load: 123; source: \"" SERVER_ADDR "/IDontExist.qml\"; onLoaded: did_load=456 }"), QUrl(QString(SERVER_ADDR "/dummy.qml")));
QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create());
QVERIFY(loader != 0);