From b42c158cbd8a2c2b487f9d98a6782abcff8df44a Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 8 Jul 2010 16:13:01 +1000 Subject: Improve test reliability. --- .../qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 9ae7c99..859221e 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -429,6 +429,8 @@ void tst_qdeclarativetextinput::horizontalAlignment() QImage expect(expectfile); QCOMPARE(actual,expect); + + delete canvas; } void tst_qdeclarativetextinput::positionAt() @@ -473,11 +475,13 @@ void tst_qdeclarativetextinput::positionAt() void tst_qdeclarativetextinput::maxLength() { - //QString componentStr = "import Qt 4.7\nTextInput { maximumLength: 10; }"; QDeclarativeView *canvas = createView(SRCDIR "/data/maxLength.qml"); + QVERIFY(canvas->rootObject() != 0); canvas->show(); canvas->setFocus(); - QVERIFY(canvas->rootObject() != 0); + QApplication::setActiveWindow(canvas); + QTest::qWaitForWindowShown(canvas); + QDeclarativeTextInput *textinputObject = qobject_cast(canvas->rootObject()); QVERIFY(textinputObject != 0); QVERIFY(textinputObject->text().isEmpty()); -- cgit v0.12