summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/debugger/qdeclarativedebugclient.cpp3
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp9
-rw-r--r--tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp14
4 files changed, 14 insertions, 13 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugclient.cpp b/src/declarative/debugger/qdeclarativedebugclient.cpp
index 5baaf70..977e58e 100644
--- a/src/declarative/debugger/qdeclarativedebugclient.cpp
+++ b/src/declarative/debugger/qdeclarativedebugclient.cpp
@@ -99,6 +99,7 @@ void QDeclarativeDebugConnectionPrivate::advertisePlugins()
QPacket pack;
pack << serverId << 1 << plugins.keys();
protocol->send(pack);
+ q->flush();
}
void QDeclarativeDebugConnectionPrivate::connected()
@@ -106,6 +107,7 @@ void QDeclarativeDebugConnectionPrivate::connected()
QPacket pack;
pack << serverId << 0 << protocolVersion << plugins.keys();
protocol->send(pack);
+ q->flush();
}
void QDeclarativeDebugConnectionPrivate::readyRead()
@@ -274,6 +276,7 @@ void QDeclarativeDebugClient::sendMessage(const QByteArray &message)
QPacket pack;
pack << d->name << message;
d->client->d->protocol->send(pack);
+ d->client->d->q->flush();
}
void QDeclarativeDebugClient::statusChanged(Status)
diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp
index 62f2f39..d2ef00d 100644
--- a/src/declarative/debugger/qdeclarativedebugservice.cpp
+++ b/src/declarative/debugger/qdeclarativedebugservice.cpp
@@ -142,6 +142,7 @@ void QDeclarativeDebugServerPrivate::advertisePlugins()
QPacket pack;
pack << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << plugins.keys();
protocol->send(pack);
+ connection->flush();
}
void QDeclarativeDebugServer::listen()
diff --git a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp
index a5f9846..80241ba 100644
--- a/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp
+++ b/tests/auto/declarative/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp
@@ -112,12 +112,10 @@ void tst_QDeclarativeDebugClient::status()
{
QDeclarativeDebugTestService service("tst_QDeclarativeDebugClient::status()");
- QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()));
- QCOMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
}
- QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()));
- QCOMPARE(client.status(), QDeclarativeDebugClient::Unavailable);
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Unavailable);
// duplicate plugin name
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugClient: Conflicting plugin name \"tst_QDeclarativeDebugClient::status()\" ");
@@ -135,7 +133,8 @@ void tst_QDeclarativeDebugClient::sendMessage()
QByteArray msg = "hello!";
- QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()));
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+
client.sendMessage(msg);
QByteArray resp = client.waitForResponse();
QCOMPARE(resp, msg);
diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp
index bce4713..538129c 100644
--- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp
+++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp
@@ -103,12 +103,12 @@ void tst_QDeclarativeDebugService::status()
{
QDeclarativeDebugTestClient client("tst_QDeclarativeDebugService::status()", m_conn);
- QDeclarativeDebugTest::waitForSignal(&service, SIGNAL(statusHasChanged()));
- QCOMPARE(service.status(), QDeclarativeDebugService::Enabled);
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(service.status(), QDeclarativeDebugService::Enabled);
}
- QDeclarativeDebugTest::waitForSignal(&service, SIGNAL(statusHasChanged()));
- QCOMPARE(service.status(), QDeclarativeDebugService::Unavailable);
+
+ QTRY_COMPARE(service.status(), QDeclarativeDebugService::Unavailable);
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugService: Conflicting plugin name \"tst_QDeclarativeDebugService::status()\" ");
@@ -123,10 +123,8 @@ void tst_QDeclarativeDebugService::sendMessage()
QByteArray msg = "hello!";
- if (service.status() != QDeclarativeDebugService::Enabled)
- QDeclarativeDebugTest::waitForSignal(&service, SIGNAL(statusHasChanged()));
- if (client.status() != QDeclarativeDebugClient::Enabled)
- QDeclarativeDebugTest::waitForSignal(&client, SIGNAL(statusHasChanged()));
+ QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
+ QTRY_COMPARE(service.status(), QDeclarativeDebugService::Enabled);
client.sendMessage(msg);
QByteArray resp = client.waitForResponse();