tst_QAccessibilityMac: Wait for accessible window to become available
It may take some time before the shown window is available through the accessible hierarchy, so do an asynchronous test for that to happen. Pick-to: 6.4 Change-Id: I3f312ae636505b805899973678b1bf10a65f96b3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
16b9f9a9aa
commit
e4147992df
@ -419,10 +419,9 @@ void tst_QAccessibilityMac::singleWidgetTest()
|
||||
TestAXObject *appObject = [TestAXObject getApplicationAXObject];
|
||||
QVERIFY(appObject);
|
||||
|
||||
NSArray *windows = [appObject windowList];
|
||||
QVERIFY([windows count] == 1);
|
||||
QTRY_VERIFY(appObject.windowList.count == 1);
|
||||
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [windows objectAtIndex: 0];
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [appObject.windowList objectAtIndex: 0];
|
||||
QVERIFY(windowRef != nil);
|
||||
TestAXObject *window = [[TestAXObject alloc] initWithAXUIElementRef: windowRef];
|
||||
|
||||
@ -449,10 +448,9 @@ void tst_QAccessibilityMac::lineEditTest()
|
||||
TestAXObject *appObject = [TestAXObject getApplicationAXObject];
|
||||
QVERIFY(appObject);
|
||||
|
||||
NSArray *windowList = [appObject windowList];
|
||||
// one window
|
||||
QVERIFY([windowList count] == 1);
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [windowList objectAtIndex: 0];
|
||||
QTRY_VERIFY(appObject.windowList.count == 1);
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [appObject.windowList objectAtIndex: 0];
|
||||
QVERIFY(windowRef != nil);
|
||||
TestAXObject *window = [[TestAXObject alloc] initWithAXUIElementRef: windowRef];
|
||||
|
||||
@ -510,10 +508,9 @@ void tst_QAccessibilityMac::hierarchyTest()
|
||||
TestAXObject *appObject = [TestAXObject getApplicationAXObject];
|
||||
QVERIFY(appObject);
|
||||
|
||||
NSArray *windowList = [appObject windowList];
|
||||
// one window
|
||||
QVERIFY([windowList count] == 1);
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [windowList objectAtIndex: 0];
|
||||
QTRY_VERIFY(appObject.windowList.count == 1);
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [appObject.windowList objectAtIndex: 0];
|
||||
QVERIFY(windowRef != nil);
|
||||
TestAXObject *window = [[TestAXObject alloc] initWithAXUIElementRef: windowRef];
|
||||
|
||||
@ -572,10 +569,9 @@ void tst_QAccessibilityMac::notificationsTest()
|
||||
TestAXObject *appObject = [TestAXObject getApplicationAXObject];
|
||||
QVERIFY(appObject);
|
||||
|
||||
NSArray *windowList = [appObject windowList];
|
||||
// one window
|
||||
QVERIFY([windowList count] == 1);
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [windowList objectAtIndex: 0];
|
||||
QTRY_VERIFY(appObject.windowList.count == 1);
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [appObject.windowList objectAtIndex: 0];
|
||||
QVERIFY(windowRef != nil);
|
||||
TestAXObject *window = [[TestAXObject alloc] initWithAXUIElementRef: windowRef];
|
||||
|
||||
@ -616,10 +612,9 @@ void tst_QAccessibilityMac::checkBoxTest()
|
||||
TestAXObject *appObject = [TestAXObject getApplicationAXObject];
|
||||
QVERIFY(appObject);
|
||||
|
||||
NSArray *windowList = [appObject windowList];
|
||||
// one window
|
||||
QVERIFY([windowList count] == 1);
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [windowList objectAtIndex: 0];
|
||||
QTRY_VERIFY(appObject.windowList.count == 1);
|
||||
AXUIElementRef windowRef = (AXUIElementRef) [appObject.windowList objectAtIndex: 0];
|
||||
QVERIFY(windowRef != nil);
|
||||
TestAXObject *window = [[TestAXObject alloc] initWithAXUIElementRef: windowRef];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user