diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-05-18 17:00:49 +1000 |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-05-18 17:00:49 +1000 |
commit | 57d9b5d3ca685ceacc0537dc9d3afdfaa243a768 (patch) | |
tree | 540741b28e79be921a2f70bf8b3545bc090cd56c /tests | |
parent | c83c123579e3064d5f9ed7333d2b4303ecf7261a (diff) |
Fix test TextEdit preeditMicroFocus test failure.
Port change from QDeclarativeTextEdit test which removed a check for
an update when the cursor position had not changed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp index 92053637c7..3e4803bc03 100644 --- a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp +++ b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp @@ -2186,6 +2186,8 @@ void tst_qsgtextedit::preeditMicroFocus() QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject()); QVERIFY(edit); + QSignalSpy cursorRectangleSpy(edit, SIGNAL(cursorRectangleChanged())); + QRect currentRect; QRect previousRect = edit->inputMethodQuery(Qt::ImMicroFocus).toRect(); @@ -2196,8 +2198,9 @@ void tst_qsgtextedit::preeditMicroFocus() currentRect = edit->inputMethodQuery(Qt::ImMicroFocus).toRect(); QCOMPARE(currentRect, previousRect); #if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) - QCOMPARE(ic.updateReceived, true); + QCOMPARE(ic.updateReceived, false); // The cursor position hasn't changed. #endif + QCOMPARE(cursorRectangleSpy.count(), 0); // Verify that the micro focus rect moves to the left as the cursor position // is incremented. @@ -2209,6 +2212,8 @@ void tst_qsgtextedit::preeditMicroFocus() #if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QCOMPARE(ic.updateReceived, true); #endif + QVERIFY(cursorRectangleSpy.count() > 0); + cursorRectangleSpy.clear(); previousRect = currentRect; } @@ -2222,6 +2227,7 @@ void tst_qsgtextedit::preeditMicroFocus() #if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) QCOMPARE(ic.updateReceived, true); #endif + QVERIFY(cursorRectangleSpy.count() > 0); } void tst_qsgtextedit::inputContextMouseHandler() |