From 79d56651edc05133ebae13bb93733373b10380f9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 22 Apr 2015 17:15:30 +0200 Subject: Prospective fix for flakey "network" related QML tests Replace hard-coded server ports with dynamically allocated ports. Change-Id: Iab8f9a88343a9f2c49af3cd700c954c13c3bf121 Reviewed-by: Frederik Gladhorn --- tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp') diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 5c8d86f840..f2cc619f41 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -58,9 +58,6 @@ #include "../../shared/platformquirks.h" #include "../../shared/platforminputcontext.h" -#define SERVER_PORT 14460 -#define SERVER_ADDR "http://localhost:14460" - Q_DECLARE_METATYPE(QQuickTextInput::SelectionMode) Q_DECLARE_METATYPE(QQuickTextInput::EchoMode) Q_DECLARE_METATYPE(Qt::Key) @@ -2859,12 +2856,12 @@ void tst_qquicktextinput::cursorDelegate() void tst_qquicktextinput::remoteCursorDelegate() { TestHTTPServer server; - QVERIFY2(server.listen(SERVER_PORT), qPrintable(server.errorString())); + QVERIFY2(server.listen(), qPrintable(server.errorString())); server.serveDirectory(dataDirectory(), TestHTTPServer::Delay); QQuickView view; - QQmlComponent component(view.engine(), QUrl(SERVER_ADDR "/RemoteCursor.qml")); + QQmlComponent component(view.engine(), server.url("/RemoteCursor.qml")); view.rootContext()->setContextProperty("contextDelegate", &component); view.setSource(testFileUrl("cursorTestRemote.qml")); -- cgit v1.2.3