diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-11-02 13:05:58 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-11-02 13:05:58 +0100 |
commit | 5169a1ecd03eaea95ab07aeefc8d76cca7530563 (patch) | |
tree | 2666aecdf5a9c90d9b68dd7df8c6b5d1507541a6 /tests/auto/accessibility/tst_accessibility.cpp | |
parent | 7decf1ee51df6c772b84ba8bed2f1e3d0e344908 (diff) | |
parent | 814601e9cdf5895152cedcd1968fd2a4eecd3cd3 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
src/imports/controls/Drawer.qml
src/imports/controls/Frame.qml
src/imports/controls/GroupBox.qml
src/imports/controls/Page.qml
src/imports/controls/Pane.qml
src/imports/controls/ToolBar.qml
src/imports/controls/Tumbler.qml
src/quicktemplates2/qquickapplicationwindow.cpp
src/quicktemplates2/qquickpopup.cpp
tests/auto/accessibility/data/busyindicator.qml
tests/auto/accessibility/data/button.qml
tests/auto/accessibility/data/checkbox.qml
tests/auto/accessibility/data/control.qml
tests/auto/accessibility/data/dial.qml
tests/auto/accessibility/data/label.qml
tests/auto/accessibility/data/menu.qml
tests/auto/accessibility/data/pageindicator.qml
tests/auto/accessibility/data/popup.qml
tests/auto/accessibility/data/progressbar.qml
tests/auto/accessibility/data/radiobutton.qml
tests/auto/accessibility/data/rangeslider.qml
tests/auto/accessibility/data/scrollbar.qml
tests/auto/accessibility/data/scrollindicator.qml
tests/auto/accessibility/data/slider.qml
tests/auto/accessibility/data/spinbox.qml
tests/auto/accessibility/data/switch.qml
tests/auto/accessibility/data/tabbar.qml
tests/auto/accessibility/data/tabbutton.qml
tests/auto/accessibility/data/textarea.qml
tests/auto/accessibility/data/textfield.qml
tests/auto/accessibility/data/toolbar.qml
tests/auto/accessibility/data/toolbutton.qml
tests/auto/accessibility/tst_accessibility.cpp
Change-Id: Ibc3f592162e97bef9147b35da8c9a79e73a907e6
Diffstat (limited to 'tests/auto/accessibility/tst_accessibility.cpp')
-rw-r--r-- | tests/auto/accessibility/tst_accessibility.cpp | 37 |
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(); } |