aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNing Chi <ext-chi.ning@nokia.com>2010-12-07 14:31:30 +0200
committerPekka Vuorela <pekka.ta.vuorela@nokia.com>2010-12-07 15:54:55 +0200
commit5806ff20dc4f4b668fbf5507d24e9e63d32840d1 (patch)
tree467bd92f5918b89f162a0713635b3559c51a6f7a
parent99430addbbcb7ccb02ab19c53449db48b9b9cc6d (diff)
Changes: update ut_mtextedit for QInputMethodEvent::Selection
RevBy: Pekka Vuorela
-rw-r--r--tests/ut_mtextedit/ut_mtextedit.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ut_mtextedit/ut_mtextedit.cpp b/tests/ut_mtextedit/ut_mtextedit.cpp
index 6d67f884..0d7bee44 100644
--- a/tests/ut_mtextedit/ut_mtextedit.cpp
+++ b/tests/ut_mtextedit/ut_mtextedit.cpp
@@ -610,6 +610,16 @@ void Ut_MTextEdit::testInputMethodEvent()
QCOMPARE(m_subject->text(), testString2);
QCOMPARE(spy.count(), 1); // optimization with preedit == commit
spy.clear();
+
+ m_subject->setText(testString);
+ int start = 0;
+ int length = 1;
+ QList<QInputMethodEvent::Attribute> attributes;
+ attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, start,
+ length, QVariant());
+ QInputMethodEvent selectionEvent("", attributes);
+ m_subject->inputMethodEvent(&selectionEvent);
+ QCOMPARE(m_subject->selectedText(), testString.mid(0, 1));
}