diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-03-22 13:32:02 (GMT) |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-03-22 13:57:15 (GMT) |
commit | 8888cef411ce1d1fc898970429e951f9ef623b0e (patch) | |
tree | 8b46ac7181c25421a99075afce07a15c256b9306 /tests/auto/qaccessibility | |
parent | 6cd51aeec11e7a70ba560c350274d5a4bd43c9b9 (diff) | |
download | Qt-8888cef411ce1d1fc898970429e951f9ef623b0e.zip Qt-8888cef411ce1d1fc898970429e951f9ef623b0e.tar.gz Qt-8888cef411ce1d1fc898970429e951f9ef623b0e.tar.bz2 |
Unit test for characterRect in Accessible TextInterface.
Diffstat (limited to 'tests/auto/qaccessibility')
-rw-r--r-- | tests/auto/qaccessibility/tst_qaccessibility.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 |