diff options
Diffstat (limited to 'tests/auto/accessibility')
51 files changed, 0 insertions, 468 deletions
diff --git a/tests/auto/accessibility/accessibility.pro b/tests/auto/accessibility/accessibility.pro deleted file mode 100644 index dd8e60a7..00000000 --- a/tests/auto/accessibility/accessibility.pro +++ /dev/null @@ -1,15 +0,0 @@ -CONFIG += testcase -TARGET = tst_accessibility -SOURCES += tst_accessibility.cpp - -macos:CONFIG -= app_bundle - -QT += core-private gui-private qml-private quick-private quicktemplates2-private testlib - -include (../shared/util.pri) - -TESTDATA = data/* - -OTHER_FILES += \ - data/*.qml - diff --git a/tests/auto/accessibility/data/abstractbutton.qml b/tests/auto/accessibility/data/abstractbutton.qml deleted file mode 100644 index b0922176..00000000 --- a/tests/auto/accessibility/data/abstractbutton.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -AbstractButton { - text: "AbstractButton" -} diff --git a/tests/auto/accessibility/data/busyindicator.qml b/tests/auto/accessibility/data/busyindicator.qml deleted file mode 100644 index e1c33765..00000000 --- a/tests/auto/accessibility/data/busyindicator.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -BusyIndicator { } diff --git a/tests/auto/accessibility/data/button.qml b/tests/auto/accessibility/data/button.qml deleted file mode 100644 index 600c05da..00000000 --- a/tests/auto/accessibility/data/button.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Button { - text: "Button" -} diff --git a/tests/auto/accessibility/data/checkbox.qml b/tests/auto/accessibility/data/checkbox.qml deleted file mode 100644 index f86a9a27..00000000 --- a/tests/auto/accessibility/data/checkbox.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -CheckBox { - text: "CheckBox" -} diff --git a/tests/auto/accessibility/data/checkdelegate.qml b/tests/auto/accessibility/data/checkdelegate.qml deleted file mode 100644 index 2750052f..00000000 --- a/tests/auto/accessibility/data/checkdelegate.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -CheckDelegate { - text: "CheckDelegate" -} diff --git a/tests/auto/accessibility/data/combobox.qml b/tests/auto/accessibility/data/combobox.qml deleted file mode 100644 index ec4e87ef..00000000 --- a/tests/auto/accessibility/data/combobox.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -ComboBox { - model: ["ComboBox"] -} diff --git a/tests/auto/accessibility/data/container.qml b/tests/auto/accessibility/data/container.qml deleted file mode 100644 index b8d57eea..00000000 --- a/tests/auto/accessibility/data/container.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Container { } diff --git a/tests/auto/accessibility/data/control.qml b/tests/auto/accessibility/data/control.qml deleted file mode 100644 index dac5f935..00000000 --- a/tests/auto/accessibility/data/control.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Control { } diff --git a/tests/auto/accessibility/data/dayofweekrow-2.qml b/tests/auto/accessibility/data/dayofweekrow-2.qml deleted file mode 100644 index 96c750cb..00000000 --- a/tests/auto/accessibility/data/dayofweekrow-2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -DayOfWeekRow { } diff --git a/tests/auto/accessibility/data/dayofweekrow.qml b/tests/auto/accessibility/data/dayofweekrow.qml deleted file mode 100644 index a2aa44ec..00000000 --- a/tests/auto/accessibility/data/dayofweekrow.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -DayOfWeekRow { - Accessible.name: "DayOfWeekRow" -} diff --git a/tests/auto/accessibility/data/dial.qml b/tests/auto/accessibility/data/dial.qml deleted file mode 100644 index 9a471548..00000000 --- a/tests/auto/accessibility/data/dial.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Dial { } diff --git a/tests/auto/accessibility/data/dialog.qml b/tests/auto/accessibility/data/dialog.qml deleted file mode 100644 index 20317a31..00000000 --- a/tests/auto/accessibility/data/dialog.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Dialog { - title: "Dialog" -} diff --git a/tests/auto/accessibility/data/drawer.qml b/tests/auto/accessibility/data/drawer.qml deleted file mode 100644 index 9b0db5fa..00000000 --- a/tests/auto/accessibility/data/drawer.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Drawer { } diff --git a/tests/auto/accessibility/data/frame.qml b/tests/auto/accessibility/data/frame.qml deleted file mode 100644 index 02e45a78..00000000 --- a/tests/auto/accessibility/data/frame.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Frame { } diff --git a/tests/auto/accessibility/data/groupbox.qml b/tests/auto/accessibility/data/groupbox.qml deleted file mode 100644 index 0fa8cff5..00000000 --- a/tests/auto/accessibility/data/groupbox.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -GroupBox { - title: "GroupBox" -} diff --git a/tests/auto/accessibility/data/itemdelegate.qml b/tests/auto/accessibility/data/itemdelegate.qml deleted file mode 100644 index 52831648..00000000 --- a/tests/auto/accessibility/data/itemdelegate.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -ItemDelegate { - text: "ItemDelegate" -} diff --git a/tests/auto/accessibility/data/label.qml b/tests/auto/accessibility/data/label.qml deleted file mode 100644 index 6d7466bc..00000000 --- a/tests/auto/accessibility/data/label.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Label { - text: "Label" -} diff --git a/tests/auto/accessibility/data/menu.qml b/tests/auto/accessibility/data/menu.qml deleted file mode 100644 index 126914d1..00000000 --- a/tests/auto/accessibility/data/menu.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Menu { } diff --git a/tests/auto/accessibility/data/menuitem.qml b/tests/auto/accessibility/data/menuitem.qml deleted file mode 100644 index 97fd478f..00000000 --- a/tests/auto/accessibility/data/menuitem.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -MenuItem { - text: "MenuItem" -} diff --git a/tests/auto/accessibility/data/monthgrid-2.qml b/tests/auto/accessibility/data/monthgrid-2.qml deleted file mode 100644 index 6368d090..00000000 --- a/tests/auto/accessibility/data/monthgrid-2.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -MonthGrid { - title: "MonthGrid" -} diff --git a/tests/auto/accessibility/data/monthgrid.qml b/tests/auto/accessibility/data/monthgrid.qml deleted file mode 100644 index 03de2499..00000000 --- a/tests/auto/accessibility/data/monthgrid.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -MonthGrid { - title: "MonthGrid" - Accessible.name: title -} diff --git a/tests/auto/accessibility/data/page.qml b/tests/auto/accessibility/data/page.qml deleted file mode 100644 index 84036878..00000000 --- a/tests/auto/accessibility/data/page.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Page { - title: "Page" -} diff --git a/tests/auto/accessibility/data/pageindicator.qml b/tests/auto/accessibility/data/pageindicator.qml deleted file mode 100644 index 30184167..00000000 --- a/tests/auto/accessibility/data/pageindicator.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -PageIndicator { } diff --git a/tests/auto/accessibility/data/pane.qml b/tests/auto/accessibility/data/pane.qml deleted file mode 100644 index bde4fad5..00000000 --- a/tests/auto/accessibility/data/pane.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Pane { } diff --git a/tests/auto/accessibility/data/popup.qml b/tests/auto/accessibility/data/popup.qml deleted file mode 100644 index 907d0c55..00000000 --- a/tests/auto/accessibility/data/popup.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Popup { } diff --git a/tests/auto/accessibility/data/progressbar.qml b/tests/auto/accessibility/data/progressbar.qml deleted file mode 100644 index 74b2cb84..00000000 --- a/tests/auto/accessibility/data/progressbar.qml +++ /dev/null @@ -1,8 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -ProgressBar { - from: 0 - to: 100 - value: 50 -} diff --git a/tests/auto/accessibility/data/radiobutton.qml b/tests/auto/accessibility/data/radiobutton.qml deleted file mode 100644 index 1b046d3e..00000000 --- a/tests/auto/accessibility/data/radiobutton.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -RadioButton { - text: "RadioButton" -} diff --git a/tests/auto/accessibility/data/radiodelegate.qml b/tests/auto/accessibility/data/radiodelegate.qml deleted file mode 100644 index f2bec8bc..00000000 --- a/tests/auto/accessibility/data/radiodelegate.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -RadioDelegate { - text: "RadioDelegate" -} diff --git a/tests/auto/accessibility/data/rangeslider.qml b/tests/auto/accessibility/data/rangeslider.qml deleted file mode 100644 index 95bff377..00000000 --- a/tests/auto/accessibility/data/rangeslider.qml +++ /dev/null @@ -1,11 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -RangeSlider { - from: 0 - to: 100 - first.value: 25 - second.value: 75 - stepSize: 1 - orientation: Qt.Horizontal -} diff --git a/tests/auto/accessibility/data/roundbutton.qml b/tests/auto/accessibility/data/roundbutton.qml deleted file mode 100644 index 20f0ed9a..00000000 --- a/tests/auto/accessibility/data/roundbutton.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -RoundButton { - text: "RoundButton" -} diff --git a/tests/auto/accessibility/data/scrollbar.qml b/tests/auto/accessibility/data/scrollbar.qml deleted file mode 100644 index 1e7cf155..00000000 --- a/tests/auto/accessibility/data/scrollbar.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -ScrollBar { } diff --git a/tests/auto/accessibility/data/scrollindicator.qml b/tests/auto/accessibility/data/scrollindicator.qml deleted file mode 100644 index 24ef9271..00000000 --- a/tests/auto/accessibility/data/scrollindicator.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -ScrollIndicator { } diff --git a/tests/auto/accessibility/data/slider.qml b/tests/auto/accessibility/data/slider.qml deleted file mode 100644 index 0d1db79c..00000000 --- a/tests/auto/accessibility/data/slider.qml +++ /dev/null @@ -1,10 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Slider { - from: 0 - to: 100 - value: 50 - stepSize: 1 - orientation: Qt.Horizontal -} diff --git a/tests/auto/accessibility/data/spinbox.qml b/tests/auto/accessibility/data/spinbox.qml deleted file mode 100644 index 3da1f868..00000000 --- a/tests/auto/accessibility/data/spinbox.qml +++ /dev/null @@ -1,9 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -SpinBox { - from: 0 - to: 100 - value: 50 - stepSize: 1 -} diff --git a/tests/auto/accessibility/data/stackview.qml b/tests/auto/accessibility/data/stackview.qml deleted file mode 100644 index 48cb384e..00000000 --- a/tests/auto/accessibility/data/stackview.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -StackView { } diff --git a/tests/auto/accessibility/data/swipedelegate.qml b/tests/auto/accessibility/data/swipedelegate.qml deleted file mode 100644 index d6f503c4..00000000 --- a/tests/auto/accessibility/data/swipedelegate.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -SwipeDelegate { - text: "SwipeDelegate" -} diff --git a/tests/auto/accessibility/data/swipeview.qml b/tests/auto/accessibility/data/swipeview.qml deleted file mode 100644 index efb185e6..00000000 --- a/tests/auto/accessibility/data/swipeview.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -SwipeView { } diff --git a/tests/auto/accessibility/data/switch.qml b/tests/auto/accessibility/data/switch.qml deleted file mode 100644 index b9c8a572..00000000 --- a/tests/auto/accessibility/data/switch.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Switch { - text: "Switch" -} diff --git a/tests/auto/accessibility/data/switchdelegate.qml b/tests/auto/accessibility/data/switchdelegate.qml deleted file mode 100644 index d0d9599c..00000000 --- a/tests/auto/accessibility/data/switchdelegate.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -SwitchDelegate { - text: "SwitchDelegate" -} diff --git a/tests/auto/accessibility/data/tabbar.qml b/tests/auto/accessibility/data/tabbar.qml deleted file mode 100644 index d65b1305..00000000 --- a/tests/auto/accessibility/data/tabbar.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -TabBar { } diff --git a/tests/auto/accessibility/data/tabbutton.qml b/tests/auto/accessibility/data/tabbutton.qml deleted file mode 100644 index 72277a9f..00000000 --- a/tests/auto/accessibility/data/tabbutton.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -TabButton { - text: "TabButton" -} diff --git a/tests/auto/accessibility/data/textarea.qml b/tests/auto/accessibility/data/textarea.qml deleted file mode 100644 index c861cda4..00000000 --- a/tests/auto/accessibility/data/textarea.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -TextArea { - text: "TextArea" -} diff --git a/tests/auto/accessibility/data/textfield.qml b/tests/auto/accessibility/data/textfield.qml deleted file mode 100644 index 222a1223..00000000 --- a/tests/auto/accessibility/data/textfield.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -TextField { - text: "TextField" -} diff --git a/tests/auto/accessibility/data/toolbar.qml b/tests/auto/accessibility/data/toolbar.qml deleted file mode 100644 index f8cbe311..00000000 --- a/tests/auto/accessibility/data/toolbar.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -ToolBar { } diff --git a/tests/auto/accessibility/data/toolbutton.qml b/tests/auto/accessibility/data/toolbutton.qml deleted file mode 100644 index 84d67cfa..00000000 --- a/tests/auto/accessibility/data/toolbutton.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -ToolButton { - text: "ToolButton" -} diff --git a/tests/auto/accessibility/data/tooltip.qml b/tests/auto/accessibility/data/tooltip.qml deleted file mode 100644 index a6f7718d..00000000 --- a/tests/auto/accessibility/data/tooltip.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -ToolTip { - text: "ToolTip" -} diff --git a/tests/auto/accessibility/data/tumbler.qml b/tests/auto/accessibility/data/tumbler.qml deleted file mode 100644 index fda5c2bd..00000000 --- a/tests/auto/accessibility/data/tumbler.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -Tumbler { } diff --git a/tests/auto/accessibility/data/weeknumbercolumn-2.qml b/tests/auto/accessibility/data/weeknumbercolumn-2.qml deleted file mode 100644 index 2c5b836b..00000000 --- a/tests/auto/accessibility/data/weeknumbercolumn-2.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -WeekNumberColumn { } diff --git a/tests/auto/accessibility/data/weeknumbercolumn.qml b/tests/auto/accessibility/data/weeknumbercolumn.qml deleted file mode 100644 index 71d533ef..00000000 --- a/tests/auto/accessibility/data/weeknumbercolumn.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.12 -import Qt.labs.calendar 1.0 - -WeekNumberColumn { - Accessible.name: "WeekNumberColumn" -} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp deleted file mode 100644 index 32803d7d..00000000 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtTest/qtest.h> -#include <QtQml/qqmlengine.h> -#include <QtQml/qqmlcomponent.h> -#include <QtQml/qqmlcontext.h> -#include <QtQuick/private/qquickitem_p.h> -#include <QtQuickTemplates2/private/qquickpopup_p.h> -#include "../shared/util.h" - -#if QT_CONFIG(accessibility) -#include <QtGui/private/qguiapplication_p.h> -#include <QtGui/qpa/qplatformintegration.h> -#include <QtGui/qpa/qplatformaccessibility.h> -#include <QtQuick/private/qquickaccessibleattached_p.h> -#endif - -class tst_accessibility : public QQmlDataTest -{ - Q_OBJECT - -private slots: - void a11y_data(); - void a11y(); - -private: - QQmlEngine engine; -}; - -void tst_accessibility::a11y_data() -{ - QTest::addColumn<QString>("name"); - QTest::addColumn<QAccessible::Role>("role"); - QTest::addColumn<QString>("text"); - - QTest::newRow("AbstractButton") << "abstractbutton" << QAccessible::Button << "AbstractButton"; - QTest::newRow("BusyIndicator") << "busyindicator" << QAccessible::Indicator << ""; - QTest::newRow("Button") << "button" << QAccessible::Button << "Button"; - QTest::newRow("CheckBox") << "checkbox" << QAccessible::CheckBox << "CheckBox"; - QTest::newRow("CheckDelegate") << "checkdelegate" << QAccessible::CheckBox << "CheckDelegate"; - QTest::newRow("ComboBox") << "combobox" << QAccessible::ComboBox << "ComboBox"; - QTest::newRow("Container") << "container" << QAccessible::NoRole << ""; - QTest::newRow("Control") << "control" << QAccessible::NoRole << ""; - QTest::newRow("Dial") << "dial" << QAccessible::Dial << ""; - QTest::newRow("Dialog") << "dialog" << QAccessible::Dialog << "Dialog"; - QTest::newRow("Drawer") << "drawer" << QAccessible::Dialog << ""; - QTest::newRow("Frame") << "frame" << QAccessible::Border << ""; - QTest::newRow("GroupBox") << "groupbox" << QAccessible::Grouping << "GroupBox"; - QTest::newRow("ItemDelegate") << "itemdelegate" << QAccessible::ListItem << "ItemDelegate"; - QTest::newRow("Label") << "label" << QAccessible::StaticText << "Label"; - QTest::newRow("Menu") << "menu" << QAccessible::PopupMenu << ""; - QTest::newRow("MenuItem") << "menuitem" << QAccessible::MenuItem << "MenuItem"; - QTest::newRow("Page") << "page" << QAccessible::PageTab << "Page"; - QTest::newRow("PageIndicator") << "pageindicator" << QAccessible::Indicator << ""; - QTest::newRow("Pane") << "pane" << QAccessible::Pane << ""; - QTest::newRow("Popup") << "popup" << QAccessible::Dialog << ""; - QTest::newRow("ProgressBar") << "progressbar" << QAccessible::ProgressBar << ""; - QTest::newRow("RadioButton") << "radiobutton" << QAccessible::RadioButton << "RadioButton"; - QTest::newRow("RadioDelegate") << "radiodelegate" << QAccessible::RadioButton << "RadioDelegate"; - QTest::newRow("RangeSlider") << "rangeslider" << QAccessible::Slider << ""; - QTest::newRow("RoundButton") << "roundbutton" << QAccessible::Button << "RoundButton"; - QTest::newRow("ScrollBar") << "scrollbar" << QAccessible::ScrollBar << ""; - QTest::newRow("ScrollIndicator") << "scrollindicator" << QAccessible::Indicator << ""; - QTest::newRow("Slider") << "slider" << QAccessible::Slider << ""; - QTest::newRow("SpinBox") << "spinbox" << QAccessible::SpinBox << ""; - QTest::newRow("StackView") << "stackview" << QAccessible::LayeredPane << ""; - QTest::newRow("SwipeDelegate") << "swipedelegate" << QAccessible::ListItem << "SwipeDelegate"; - QTest::newRow("SwipeView") << "swipeview" << QAccessible::PageTabList << ""; - QTest::newRow("Switch") << "switch" << QAccessible::Button << "Switch"; - QTest::newRow("SwitchDelegate") << "switchdelegate" << QAccessible::ListItem << "SwitchDelegate"; - QTest::newRow("TabBar") << "tabbar" << QAccessible::PageTabList << ""; - QTest::newRow("TabButton") << "tabbutton" << QAccessible::PageTab << "TabButton"; - QTest::newRow("TextArea") << "textarea" << QAccessible::EditableText << ""; - QTest::newRow("TextField") << "textfield" << QAccessible::EditableText << ""; - QTest::newRow("ToolBar") << "toolbar" << QAccessible::ToolBar << ""; - QTest::newRow("ToolButton") << "toolbutton" << QAccessible::Button << "ToolButton"; - QTest::newRow("ToolTip") << "tooltip" << QAccessible::ToolTip << "ToolTip"; - QTest::newRow("Tumbler") << "tumbler" << QAccessible::NoRole << ""; // (TODO) - - QTest::newRow("DayOfWeekRow") << "dayofweekrow" << QAccessible::NoRole << "DayOfWeekRow"; - QTest::newRow("MonthGrid") << "monthgrid" << QAccessible::NoRole << "MonthGrid"; - QTest::newRow("WeekNumberColumn") << "weeknumbercolumn" << QAccessible::NoRole << "WeekNumberColumn"; -} - -#if QT_CONFIG(accessibility) -static QPlatformAccessibility *platformAccessibility() -{ - QPlatformIntegration *pfIntegration = QGuiApplicationPrivate::platformIntegration(); - return pfIntegration ? pfIntegration->accessibility() : nullptr; -} -#endif - -void tst_accessibility::a11y() -{ - QFETCH(QString, name); - QFETCH(QAccessible::Role, role); - QFETCH(QString, text); - - QString fn = name; -#if !QT_CONFIG(accessibility) - if (name == QLatin1String("dayofweekrow") - || name == QLatin1String("monthgrid") - || name == QLatin1String("weeknumbercolumn")) - fn += QLatin1String("-2"); -#endif - - QQmlComponent component(&engine); - component.loadUrl(testFileUrl(fn + ".qml")); - - QScopedPointer<QObject> object(component.create()); - QVERIFY2(!object.isNull(), qPrintable(component.errorString())); - - QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); - if (!item) { - QQuickPopup *popup = qobject_cast<QQuickPopup *>(object.data()); - if (popup) - item = popup->popupItem(); - } - QVERIFY(item); - -#if QT_CONFIG(accessibility) - QQuickAccessibleAttached *acc = QQuickAccessibleAttached::attachedProperties(item); - if (name != QLatin1String("dayofweekrow") - && name != QLatin1String("monthgrid") - && name != QLatin1String("weeknumbercolumn")) { - if (QAccessible::isActive()) { - QVERIFY(acc); - } else { - QVERIFY(!acc); - QPlatformAccessibility *accessibility = platformAccessibility(); - if (!accessibility) - QSKIP("No QPlatformAccessibility available."); - accessibility->setActive(true); - acc = QQuickAccessibleAttached::attachedProperties(item); - } - } - QVERIFY(acc); - QCOMPARE(acc->role(), role); - QCOMPARE(acc->name(), text); -#else - Q_UNUSED(role) - Q_UNUSED(text) -#endif -} - -QTEST_MAIN(tst_accessibility) - -#include "tst_accessibility.moc" |