From d517c386b295cc81e9af1c9768c50bb7251a8cd6 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 6 Feb 2017 15:36:54 +0100 Subject: [PATCH] Enable tst_qaccessibilitymac The test was disabled because it was checking if we had the right permissions. It does seem as if the permissions do not matter as long as everything is in process though. As seen by the regression in fafdb171e0c317ee8f871dc7b504d3713d5860eb it's important to run the test. This regression would have been caught. Change-Id: Ia1938e683badd1de2657aa6dc8a3b3bbe430e8c8 Reviewed-by: Qt CI Bot Reviewed-by: Frederik Gladhorn --- .../tst_qaccessibilitymac.cpp | 15 --------------- .../tst_qaccessibilitymac_helpers.h | 2 -- .../tst_qaccessibilitymac_helpers.mm | 19 ------------------- 3 files changed, 36 deletions(-) diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp index efa724b730..13c933aa14 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp @@ -94,9 +94,6 @@ void tst_QAccessibilityMac::cleanup() void tst_QAccessibilityMac::singleWidgetTest() { - if (!macNativeAccessibilityEnabled()) - return; - delete m_window; m_window = 0; @@ -105,9 +102,6 @@ void tst_QAccessibilityMac::singleWidgetTest() void tst_QAccessibilityMac::lineEditTest() { - if (!macNativeAccessibilityEnabled()) - return; - QLineEdit *lineEdit = new QLineEdit(m_window); lineEdit->setText("a11y test QLineEdit"); m_window->addWidget(lineEdit); @@ -119,9 +113,6 @@ void tst_QAccessibilityMac::lineEditTest() void tst_QAccessibilityMac::hierarchyTest() { - if (!macNativeAccessibilityEnabled()) - return; - QWidget *w = new QWidget(m_window); m_window->addWidget(w); @@ -141,17 +132,11 @@ void tst_QAccessibilityMac::hierarchyTest() void tst_QAccessibilityMac::notificationsTest() { - if (!macNativeAccessibilityEnabled()) - return; - QVERIFY(notifications(m_window)); } void tst_QAccessibilityMac::checkBoxTest() { - if (!macNativeAccessibilityEnabled()) - return; - QCheckBox *cb = new QCheckBox(m_window); cb->setText("Great option"); m_window->addWidget(cb); diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h index 5f10513bb5..75b2d39a00 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h @@ -33,8 +33,6 @@ QT_USE_NAMESPACE -bool macNativeAccessibilityEnabled(); -bool trusted(); bool testLineEdit(); bool testHierarchy(QWidget *w); bool singleWidget(); diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm index fb030aa4be..e9407fd903 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm @@ -42,19 +42,6 @@ QT_USE_NAMESPACE -bool macNativeAccessibilityEnabled() -{ - bool enabled = AXAPIEnabled(); - if (!enabled) - qWarning() << "Accessibility is disabled (check System Preferences) skipping test."; - return enabled; -} - -bool trusted() -{ - return AXIsProcessTrusted(); -} - struct AXErrorTag { AXError err; explicit AXErrorTag(AXError theErr) : err(theErr) {} @@ -413,12 +400,6 @@ bool singleWidget() bool testLineEdit() { -// not sure if this is needed. on my machine the calls succeed. -// NSString *path = @"/Users/frederik/qt5/qtbase/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.app/Contents/MacOS/tst_qaccessibilitymac"; -// NSString *path = @"/Users/frederik/qt5/qtbase/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.app"; -// AXError e = AXMakeProcessTrusted((CFStringRef) path); -// NSLog(@"error: %i", e); - TestAXObject *appObject = [TestAXObject getApplicationAXObject]; EXPECT(appObject);