summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
authorAndré de la Rocha <andre.rocha@qt.io>2022-03-31 00:54:45 -0300
committerAndré de la Rocha <andre.rocha@qt.io>2022-03-31 09:04:08 -0300
commit37b702dc124235e469b4ef0a810f3ddeaa33565e (patch)
tree00478ed18ab7a3aa3f7a9deaa3e931f135edc94f /tests/auto/other
parentaa451b13b0914e3c33a4e05e792aa8c5effa7a3a (diff)
Windows: Fix accessibility tests
Accessibility tests were not being built on Windows as they were depending on a WindowsUIAutomationSupport internal module that no longer exists, as the UI Automation support classes are now in QtGui. The patch also fixes a test that was calculating widget geometry incorrectly on high DPI screens. Pick-to: 6.2 6.3 Change-Id: Iefed0f6d147853484dfab4b16838b9088fd32dcf Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/qaccessibility/CMakeLists.txt6
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp7
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/auto/other/qaccessibility/CMakeLists.txt b/tests/auto/other/qaccessibility/CMakeLists.txt
index c516188396..1d7b1c3901 100644
--- a/tests/auto/other/qaccessibility/CMakeLists.txt
+++ b/tests/auto/other/qaccessibility/CMakeLists.txt
@@ -4,12 +4,6 @@ if(NOT QT_FEATURE_accessibility)
return()
endif()
-# special case begin
-if (WIN32 AND NOT TARGET Qt::WindowsUIAutomationSupport)
- return()
-endif()
-# special case end
-
#####################################################################
## tst_qaccessibility Test:
#####################################################################
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index a593a91525..95223057a0 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -3867,7 +3867,12 @@ void tst_QAccessibility::bridgeTest()
RECT rect;
hr = buttonElement->get_CurrentBoundingRectangle(&rect);
QVERIFY(SUCCEEDED(hr));
- QCOMPARE(buttonRect, QRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top));
+ const QRect boundingRect(rect.left, rect.top, rect.right - rect.left + 1, rect.bottom - rect.top + 1);
+ const QRectF nativeRect = QHighDpi::toNativePixels(QRectF(buttonRect), window.windowHandle());
+ const QRect truncRect(int(nativeRect.left()), int(nativeRect.top()),
+ int(nativeRect.right()) - int(nativeRect.left()) + 1,
+ int(nativeRect.bottom()) - int(nativeRect.top()) + 1);
+ QCOMPARE(truncRect, boundingRect);
buttonElement->Release();