summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/languagechange/tst_languagechange.cpp4
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp34
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp2
3 files changed, 36 insertions, 4 deletions
diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp
index 8f99730a192..ab9244c8561 100644
--- a/tests/auto/other/languagechange/tst_languagechange.cpp
+++ b/tests/auto/other/languagechange/tst_languagechange.cpp
@@ -172,10 +172,10 @@ void tst_languageChange::retranslatability_data()
<< "QFileDialog::Back"
<< "QFileDialog::Create New Folder"
<< "QFileDialog::Detail View"
- << "QFileDialog::Files of type:"
+ << "QFileDialog::Files of &type:"
<< "QFileDialog::Forward"
<< "QFileDialog::List View"
- << "QFileDialog::Look in:"
+ << "QFileDialog::&Look in:"
<< "QFileDialog::Open"
<< "QFileDialog::Parent Directory"
<< "QFileDialog::Show "
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index bf3efca35b2..764644bb192 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());
@@ -1788,6 +1793,15 @@ void tst_QAccessibility::spinBoxTest()
QAccessibleTextInterface *textIface = interface->textInterface();
QVERIFY(textIface);
+ QVERIFY(!spinBox->isReadOnly());
+ QVERIFY(interface->state().editable);
+ QVERIFY(!interface->state().readOnly);
+
+ spinBox->setReadOnly(true);
+ QVERIFY(spinBox->isReadOnly());
+ QVERIFY(!interface->state().editable);
+ QVERIFY(interface->state().readOnly);
+
QTestAccessibility::clearEvents();
}
@@ -1899,6 +1913,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 +2344,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)