diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-07-08 06:13:01 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-07-08 22:22:01 (GMT) |
commit | b42c158cbd8a2c2b487f9d98a6782abcff8df44a (patch) | |
tree | 0f85c495f6b1fc156917f5e7c1ec4d4d52bd6693 /tests/auto | |
parent | 3cf6e87b17d6ca722eea804d8e758879836f63fd (diff) | |
download | Qt-b42c158cbd8a2c2b487f9d98a6782abcff8df44a.zip Qt-b42c158cbd8a2c2b487f9d98a6782abcff8df44a.tar.gz Qt-b42c158cbd8a2c2b487f9d98a6782abcff8df44a.tar.bz2 |
Improve test reliability.
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 8 |
1 files 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<QDeclarativeTextInput *>(canvas->rootObject()); QVERIFY(textinputObject != 0); QVERIFY(textinputObject->text().isEmpty()); |