Fix tst_qquicktextinput::remoteCursorDelegate
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>
Tue, 23 Jul 2013 19:04:41 +0000 (16:04 -0300)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 25 Jul 2013 22:28:52 +0000 (00:28 +0200)
Do not query for QQmlComponent::Loading on remoteCursorDelegate: when a new
connection is established to the test http server, it will setup a single
shot QTimer with a 500ms timeout that will trigger the reply to be sent
back, making the call to sendDelayedItem() obsolete and reduntant. Also, it
means that in some platforms, data will arrive back to the component before
the check for QQmlComponent::Loading is executed, causing the test to fail
since at this point the status will already be QQmlComponent::Ready instead.

Change-Id: I30adeed2a669d5f6618f56d8a023fe7eaea16bc0
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp

index def1c76..06b757d 100644 (file)
@@ -2775,7 +2775,6 @@ void tst_qquicktextinput::cursorDelegate()
 
 void tst_qquicktextinput::remoteCursorDelegate()
 {
-    QSKIP("This test is unstable");
     TestHTTPServer server(SERVER_PORT);
     server.serveDirectory(dataDirectory(), TestHTTPServer::Delay);
 
@@ -2799,10 +2798,6 @@ void tst_qquicktextinput::remoteCursorDelegate()
     textInputObject->setFocus(true);
     QVERIFY(textInputObject->isCursorVisible());
 
-    QCOMPARE(component.status(), QQmlComponent::Loading);
-    QVERIFY(!textInputObject->findChild<QQuickItem*>("cursorInstance"));
-    server.sendDelayedItem();
-
     // Wait for component to load.
     QTRY_COMPARE(component.status(), QQmlComponent::Ready);
     QVERIFY(textInputObject->findChild<QQuickItem*>("cursorInstance"));