summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebengineaccessibility
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-15 17:55:08 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-16 18:22:50 +0200
commite50e838fd4d3b7592f84ae846a9975ada5fb09c9 (patch)
tree76654b7ad97e33281d1b659a86c3aef0fe562713 /tests/auto/widgets/qwebengineaccessibility
parent7cf9586ca965cbc31373fcb473659cfec6178945 (diff)
Implement accessibility hit testing
childAt needs to return any child at the given coordinates. Change-Id: I19bfbd24a9bfc868fd1602f058cb9ce873ceef52 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'tests/auto/widgets/qwebengineaccessibility')
-rw-r--r--tests/auto/widgets/qwebengineaccessibility/tst_qwebengineaccessibility.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/widgets/qwebengineaccessibility/tst_qwebengineaccessibility.cpp b/tests/auto/widgets/qwebengineaccessibility/tst_qwebengineaccessibility.cpp
index 8d98b06e..d0c4fd52 100644
--- a/tests/auto/widgets/qwebengineaccessibility/tst_qwebengineaccessibility.cpp
+++ b/tests/auto/widgets/qwebengineaccessibility/tst_qwebengineaccessibility.cpp
@@ -126,6 +126,19 @@ void tst_QWebEngineView::hierarchy()
QCOMPARE(input->text(QAccessible::Name), QString());
QCOMPARE(input->text(QAccessible::Description), QString());
QCOMPARE(input->text(QAccessible::Value), QStringLiteral("some text"));
+
+ QRect windowRect = webView.geometry();
+ QRect inputRect = input->rect();
+ QVERIFY(!inputRect.isEmpty());
+ QVERIFY(windowRect.contains(inputRect));
+ QPoint inputCenter = inputRect.center();
+ QAccessibleInterface *hitTest = view;
+ QAccessibleInterface *child = Q_NULLPTR;
+ while (hitTest) {
+ child = hitTest;
+ hitTest = hitTest->childAt(inputCenter.x(), inputCenter.y());
+ }
+ QCOMPARE(input, child);
}
void tst_QWebEngineView::text()