summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index ac90f6ea72..653cc6b9d9 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -939,29 +939,19 @@ void tst_QAccessibility::mainWindowTest()
window.show();
QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
-// We currently don't have an accessible interface for QWindow
-// the active state is either in the QMainWindow or QQuickView
-// QAccessibleInterface *windowIface(QAccessible::queryAccessibleInterface(&window));
-// QVERIFY(windowIface->state().active);
+ // We currently don't have an accessible interface for QWindow
+ // the active state is either in the QMainWindow or QQuickView
+ QAccessibleInterface *windowIface(QAccessible::queryAccessibleInterface(&window));
+ QVERIFY(!windowIface);
QAccessible::State activeState;
activeState.active = true;
- QAccessibleStateChangeEvent active(&window, activeState);
- QVERIFY_EVENT(&active);
-
- QWindow child;
- child.setParent(&window);
- child.setGeometry(10, 10, 20, 20);
- child.show();
-
- child.requestActivate();
- QTRY_VERIFY(QGuiApplication::focusWindow() == &child);
+ // We should still not crash if we somehow end up sending state change events
+ // Note that we do not QVERIFY_EVENT, as that relies on the updateHandler being
+ // called, which does not happen/make sense when there's no interface for the event.
+ QAccessibleStateChangeEvent active(&window, activeState);
QAccessibleStateChangeEvent deactivate(&window, activeState);
- QVERIFY_EVENT(&deactivate); // deactivation of parent
-
- QAccessibleStateChangeEvent activeChild(&child, activeState);
- QVERIFY_EVENT(&activeChild);
}
}