From 8888cef411ce1d1fc898970429e951f9ef623b0e Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 22 Mar 2011 14:32:02 +0100 Subject: Unit test for characterRect in Accessible TextInterface. --- tests/auto/qaccessibility/tst_qaccessibility.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 8d9603b..72254be 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -2679,6 +2679,11 @@ void tst_QAccessibility::textEditTest() QCOMPARE(iface->text(QAccessible::Value, 4), QString("hello world")); QCOMPARE(iface->text(QAccessible::Value, 5), QString("how are you today?")); QCOMPARE(iface->text(QAccessible::Value, 6), QString()); + QCOMPARE(iface->textInterface()->characterCount(), 31); + QFontMetrics fm(edit.font()); + QCOMPARE(iface->textInterface()->characterRect(0, QAccessible2::RelativeToParent).size(), QSize(fm.width("h"), fm.height())); + QCOMPARE(iface->textInterface()->characterRect(5, QAccessible2::RelativeToParent).size(), QSize(fm.width(" "), fm.height())); + QCOMPARE(iface->textInterface()->characterRect(6, QAccessible2::RelativeToParent).size(), QSize(fm.width("w"), fm.height())); } QTestAccessibility::clearEvents(); #else -- cgit v0.12