aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/accessibility/tst_accessibility.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/accessibility/tst_accessibility.cpp')
-rw-r--r--tests/auto/accessibility/tst_accessibility.cpp37
1 files changed, 17 insertions, 20 deletions
diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp
index fc3be1cb..53cb6973 100644
--- a/tests/auto/accessibility/tst_accessibility.cpp
+++ b/tests/auto/accessibility/tst_accessibility.cpp
@@ -34,27 +34,21 @@
**
****************************************************************************/
-#include <qtest.h>
-#include <QtTest/QSignalSpy>
+#include <QtTest/qtest.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlcontext.h>
-#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuickTemplates2/private/qquickpopup_p.h>
#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
#ifndef QT_NO_ACCESSIBILITY
#include <QtQuick/private/qquickaccessibleattached_p.h>
#endif
-using namespace QQuickVisualTestUtil;
-
class tst_accessibility : public QQmlDataTest
{
Q_OBJECT
-public:
private slots:
void a11y_data();
@@ -73,12 +67,18 @@ void tst_accessibility::a11y_data()
QTest::newRow("BusyIndicator") << "busyindicator" << 0x00000027 << ""; //QAccessible::Indicator
QTest::newRow("Button") << "button" << 0x0000002B << "Button"; //QAccessible::Button
QTest::newRow("CheckBox") << "checkbox" << 0x0000002C << "CheckBox"; //QAccessible::CheckBox
+ QTest::newRow("CheckDelegate") << "checkdelegate" << 0x0000002C << "CheckDelegate"; //QAccessible::CheckBox
+ QTest::newRow("ComboBox") << "combobox" << 0x0000002E << "ComboBox"; //QAccessible::ComboBox
QTest::newRow("Dialog") << "dialog" << 0x00000012 << ""; //QAccessible::Dialog
- // Frame
- // GroupBox
+ QTest::newRow("Frame") << "frame" << 0x00000013 << ""; //QAccessible::Border
+ QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping
+ QTest::newRow("ItemDelegate") << "itemdelegate" << 0x00000022 << "ItemDelegate"; //QAccessible::ListItem
QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText
QTest::newRow("Menu") << "menu" << 0x0000000B << ""; //QAccessible::PopupMenu
+ QTest::newRow("MenuItem") << "menuitem" << 0x0000000C << "MenuItem"; //QAccessible::MenuItem
+ QTest::newRow("Page") << "page" << 0x00000025 << "Page"; //QAccessible::PageTab
QTest::newRow("PageIndicator") << "pageindicator" << 0x00000027 << ""; //QAccessible::Indicator
+ QTest::newRow("Pane") << "pane" << 0x00000010 << ""; //QAccessible::Pane
QTest::newRow("Popup") << "popup" << 0x00000080 << ""; //QAccessible::LayeredPane
QTest::newRow("ProgressBar") << "progressbar" << 0x00000030 << ""; //QAccessible::ProgressBar
QTest::newRow("RadioButton") << "radiobutton" << 0x0000002D << "RadioButton"; //QAccessible::RadioButton
@@ -89,12 +89,14 @@ void tst_accessibility::a11y_data()
QTest::newRow("SpinBox") << "spinbox" << 0x00000034 << ""; //QAccessible::SpinBox
// StackView
QTest::newRow("Switch") << "switch" << 0x0000002B << "Switch"; //QAccessible::Button
+ QTest::newRow("SwitchDelegate") << "switchdelegate" << 0x00000022 << "SwitchDelegate"; //QAccessible::ListItem
QTest::newRow("TabBar") << "tabbar" << 0x0000003C << ""; //QAccessible::PageTabList
QTest::newRow("TabButton") << "tabbutton" << 0x00000025 << "TabButton"; //QAccessible::PageTab
QTest::newRow("TextArea") << "textarea" << 0x0000002A << ""; //QAccessible::Accessible.EditableText
QTest::newRow("TextField") << "textfield" << 0x0000002A << ""; //QAccessible::Accessible.EditableText
QTest::newRow("ToolBar") << "toolbar" << 0x00000016 << ""; //QAccessible::ToolBar
QTest::newRow("ToolButton") << "toolbutton" << 0x0000002B << "ToolButton"; //QAccessible::Button
+ QTest::newRow("ToolTip") << "tooltip" << 0x0000000D << "ToolTip"; //QAccessible::ToolTip
QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial
// Drawer
@@ -120,7 +122,6 @@ void tst_accessibility::a11y()
QFETCH(int, role);
QFETCH(QString, text);
- QQmlComponent component(&engine);
QString fn = name;
#ifdef QT_NO_ACCESSIBILITY
if (name == QLatin1Literal("dayofweekrow")
@@ -128,20 +129,16 @@ void tst_accessibility::a11y()
|| name == QLatin1Literal("weeknumbercolumn"))
fn += QLatin1Literal("-2");
#endif
+
+ QQmlComponent component(&engine);
component.loadUrl(testFileUrl(fn + ".qml"));
- QObject* created = component.create();
- QVERIFY2(created, qPrintable(component.errorString()));
- QScopedPointer<QObject> cleanup(created);
- QVERIFY(!cleanup.isNull());
- QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
- QVERIFY(window);
- window->show();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
- QQuickItem *item = findItem<QQuickItem>(window->contentItem(), name);
+ QQuickItem *item = qobject_cast<QQuickItem *>(object.data());
if (!item) {
- QQuickPopup *popup = window->contentItem()->findChild<QQuickPopup *>(name);
+ QQuickPopup *popup = qobject_cast<QQuickPopup *>(object.data());
if (popup)
item = popup->popupItem();
}