summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2021-02-03 11:49:47 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-05 07:20:09 +0000
commitd482d8b1b5ecf447c41f47db140f1c9e15177477 (patch)
tree9b7144d6ffb972d70dc4610c50bd6a442b5963f5 /tests
parentd0702bef50f6e8f468dccb2c724ea905d9d19ccc (diff)
a11y: Report mixed state if QCheckBox is PartiallyChecked
Previously it only returned checked or unchecked for a tri-state checkbox. Fixes: QTBUG-84616 Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f4887aca1e5ac7b90abf862d7c9828417a74a1b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp2
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h3
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm5
3 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp
index ba0562f049..e684c1ee34 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp
@@ -143,7 +143,7 @@ void tst_QAccessibilityMac::checkBoxTest()
QVERIFY(QTest::qWaitForWindowExposed(m_window));
QCoreApplication::processEvents();
- QVERIFY(testCheckBox());
+ QVERIFY(testCheckBox(cb));
}
QTEST_MAIN(tst_QAccessibilityMac)
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h
index 75b2d39a00..58ea2d02b0 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h
@@ -28,6 +28,7 @@
#include <QtCore/QString>
#include <QtCore/QPair>
#include <QtWidgets/QWidget>
+#include <QtWidgets/QCheckBox>
#pragma once // Yeah, it's deprecated in general, but it's standard practice for Mac OS X.
@@ -37,4 +38,4 @@ bool testLineEdit();
bool testHierarchy(QWidget *w);
bool singleWidget();
bool notifications(QWidget *w);
-bool testCheckBox();
+bool testCheckBox(QCheckBox *ckBox);
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
index 4ebf7a37f9..d97a0db939 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
@@ -565,7 +565,7 @@ bool notifications(QWidget *w)
return true;
}
-bool testCheckBox()
+bool testCheckBox(QCheckBox *ckBox)
{
TestAXObject *appObject = [TestAXObject getApplicationAXObject];
EXPECT(appObject);
@@ -596,5 +596,8 @@ bool testCheckBox()
[cb performAction:kAXPressAction];
EXPECT([cb valueNumber] == 0);
+ ckBox->setCheckState(Qt::PartiallyChecked);
+ EXPECT([cb valueNumber] == 2);
+
return true;
}