summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp25
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp2
2 files changed, 25 insertions, 2 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index bf3efca35b2..2e92cdffada 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -1357,6 +1357,11 @@ void tst_QAccessibility::scrollBarTest()
scrollBar->setMinimum(11);
scrollBar->setMaximum(111);
+ QAccessibleAttributesInterface *attributesIface = scrollBarInterface->attributesInterface();
+ QVERIFY(attributesIface);
+ QVERIFY(attributesIface->attributeKeys().contains(QAccessible::Attribute::Orientation));
+ QCOMPARE(attributesIface->attributeValue(QAccessible::Attribute::Orientation), Qt::Horizontal);
+
QAccessibleValueInterface *valueIface = scrollBarInterface->valueInterface();
QVERIFY(valueIface != 0);
QCOMPARE(valueIface->minimumValue().toInt(), scrollBar->minimum());
@@ -1899,6 +1904,20 @@ void tst_QAccessibility::textEditTest()
QCOMPARE(textIface->textAtOffset(15, QAccessible::LineBoundary, &startOffset, &endOffset), QString("How are you today?"));
QCOMPARE(startOffset, 13);
QCOMPARE(endOffset, 31);
+
+ QCOMPARE(textIface->textAfterOffset(3, QAccessible::WordBoundary, &startOffset, &endOffset),
+ QString("world"));
+ QCOMPARE(
+ textIface->textBeforeOffset(8, QAccessible::WordBoundary, &startOffset, &endOffset),
+ QString("hello"));
+ // no more word before or after the last one
+ QCOMPARE(
+ textIface->textBeforeOffset(1, QAccessible::WordBoundary, &startOffset, &endOffset),
+ QString());
+ QCOMPARE(textIface->textAfterOffset(textIface->characterCount() - 1,
+ QAccessible::WordBoundary, &startOffset, &endOffset),
+ QString());
+
QCOMPARE(textIface->characterCount(), 48);
QFontMetrics fm(edit.document()->defaultFont());
QCOMPARE(textIface->characterRect(0).size(), QSize(fm.horizontalAdvance("h"), fm.height()));
@@ -2316,6 +2335,12 @@ void tst_QAccessibility::lineEditTest()
QCOMPARE(textIface->textAtOffset(5, QAccessible::LineBoundary,&start,&end), cite);
QCOMPARE(textIface->textAtOffset(5, QAccessible::NoBoundary,&start,&end), cite);
+ le3->setText("Hello");
+ QCOMPARE(textIface->textAtOffset(1, QAccessible::WordBoundary, &start, &end),
+ QString::fromLatin1("Hello"));
+ QCOMPARE(textIface->textBeforeOffset(1, QAccessible::WordBoundary, &start, &end), QString());
+ QCOMPARE(textIface->textAfterOffset(1, QAccessible::WordBoundary, &start, &end), QString());
+
QTestAccessibility::clearEvents();
}
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index c1b72d4d623..b4cfb0f4f79 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -364,7 +364,6 @@ void tst_QFocusEvent::checkReason_ActiveWindow()
Window window;
window.show();
- window.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&window));
if (windowActivationReasonFail)
@@ -374,7 +373,6 @@ void tst_QFocusEvent::checkReason_ActiveWindow()
Window window2;
window2.show();
- window2.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&window2));
if (windowActivationReasonFail)