Unit test for characterRect in Accessible TextInterface.

(cherry picked from commit 8888cef411ce1d1fc898970429e951f9ef623b0e)
This commit is contained in:
Frederik Gladhorn 2011-03-22 14:32:02 +01:00 committed by Olivier Goffart
parent ed8f1a09f8
commit 74060f05d1

View File

@ -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