From: Rafael Roquetto Date: Mon, 22 Jul 2013 20:40:22 +0000 (-0300) Subject: Fix tst_qquicktextedit X-Git-Tag: upstream/5.2.1~677^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2a1db155bd9cb803abc5d98278cc425b0995c18;p=platform%2Fupstream%2Fqtdeclarative.git Fix tst_qquicktextedit - Use showNormal() instead of show() to keep expected window sizes on fullscreen platforms. - Use consistent point size for hAlignVisual - 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: I6508c28fa55a1aa2ae5861922701a8c322342380 Reviewed-by: Thomas McGuire Reviewed-by: Wolfgang Bremer Reviewed-by: Frederik Gladhorn --- diff --git a/tests/auto/quick/qquicktextedit/data/hAlignVisual.qml b/tests/auto/quick/qquicktextedit/data/hAlignVisual.qml index 9c9318d..017bab9 100644 --- a/tests/auto/quick/qquicktextedit/data/hAlignVisual.qml +++ b/tests/auto/quick/qquicktextedit/data/hAlignVisual.qml @@ -9,5 +9,6 @@ Rectangle { text: "AA\nBBBBBBB\nCCCCCCCCCCCCCCCC" anchors.centerIn: parent horizontalAlignment: Text.AlignLeft + font.pointSize: 12 } } diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index 6e74d84..a5cf916 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -654,7 +654,7 @@ void tst_qquicktextedit::hAlign_RightToLeft() QQuickView window(testFileUrl("horizontalAlignment_RightToLeft.qml")); QQuickTextEdit *textEdit = window.rootObject()->findChild("text"); QVERIFY(textEdit != 0); - window.show(); + window.showNormal(); const QString rtlText = textEdit->text(); @@ -832,7 +832,7 @@ void tst_qquicktextedit::hAlignVisual() { QQuickView view(testFileUrl("hAlignVisual.qml")); view.setFlags(view.flags() | Qt::WindowStaysOnTopHint); // Prevent being obscured by other windows. - view.show(); + view.showNormal(); QVERIFY(QTest::qWaitForWindowExposed(&view)); QQuickText *text = view.rootObject()->findChild("textItem"); @@ -1262,7 +1262,7 @@ void tst_qquicktextedit::focusOnPress() QQuickWindow window; window.resize(100, 50); textEditObject->setParentItem(window.contentItem()); - window.show(); + window.showNormal(); window.requestActivate(); QTest::qWaitForWindowActive(&window); @@ -2530,7 +2530,7 @@ void tst_qquicktextedit::remoteCursorDelegate() view.rootContext()->setContextProperty("contextDelegate", &component); view.setSource(testFileUrl("cursorTestRemote.qml")); - view.show(); + view.showNormal(); view.requestActivate(); QTest::qWaitForWindowActive(&view); QQuickTextEdit *textEditObject = view.rootObject()->findChild("textEditObject"); @@ -2544,10 +2544,6 @@ void tst_qquicktextedit::remoteCursorDelegate() textEditObject->setFocus(true); QVERIFY(textEditObject->isCursorVisible()); - QCOMPARE(component.status(), QQmlComponent::Loading); - QVERIFY(!textEditObject->findChild("cursorInstance")); - server.sendDelayedItem(); - // Wait for component to load. QTRY_COMPARE(component.status(), QQmlComponent::Ready); QVERIFY(textEditObject->findChild("cursorInstance")); @@ -3057,7 +3053,7 @@ void tst_qquicktextedit::openInputPanel() inputMethodPrivate->testContext = &platformInputContext; QQuickView view(testFileUrl("openInputPanel.qml")); - view.show(); + view.showNormal(); view.requestActivate(); QTest::qWaitForWindowActive(&view);