summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/qaccessibilitymac
diff options
context:
space:
mode:
authorBoris Dušek <me@dusek.me>2015-01-01 20:44:29 +0100
committerBoris Dušek <me@dusek.me>2015-01-17 09:58:14 +0100
commit8a1e6f48f5df0f62de8361a0e577550101ac6da2 (patch)
tree35be2b37dc708019da508fd33243a8e300469643 /tests/auto/other/qaccessibilitymac
parent37956e6605dd5d5a714607a7e04217d293d9c25f (diff)
Fix qaccessibilitymac test (title vs. description)
We tested button's AXDescription, which is however used only for non-textual buttons (e.g. buttons with an icon and without a visible text). On the other hand, button's visible text (which is our case) is exposed in AXTitle (and not in AXDescription). Change-Id: Ie89c758cf94b72ade3a440561c5f3df61a4c4612 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'tests/auto/other/qaccessibilitymac')
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
index a0dfe5446e..4c57e4d42a 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
@@ -80,11 +80,13 @@ bool trusted()
{
AXUIElementRef reference;
NSString *_role;
+ NSString *_title;
NSString *_description;
NSString *_value;
CGRect _rect;
}
@property (readonly) NSString *role;
+ @property (readonly) NSString *title;
@property (readonly) NSString *description;
@property (readonly) NSString *value;
@property (readonly) CGRect rect;
@@ -93,6 +95,7 @@ bool trusted()
@implementation TestAXObject
@synthesize role = _role;
+ @synthesize title = _title;
@synthesize description = _description;
@synthesize value = _value;
@synthesize rect = _rect;
@@ -102,6 +105,7 @@ bool trusted()
if ( self = [super init] ) {
reference = ref;
AXUIElementCopyAttributeValue(ref, kAXRoleAttribute, (CFTypeRef*)&_role);
+ AXUIElementCopyAttributeValue(ref, kAXTitleAttribute, (CFTypeRef*)&_title);
AXUIElementCopyAttributeValue(ref, kAXDescriptionAttribute, (CFTypeRef*)&_description);
AXUIElementCopyAttributeValue(ref, kAXValueAttribute, (CFTypeRef*)&_value);
AXValueRef sizeValue;
@@ -116,7 +120,7 @@ bool trusted()
- (AXUIElementRef) ref { return reference; }
- (void) print {
- NSLog(@"Accessible Object role: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.description, self.value, NSStringFromRect(self.rect));
+ NSLog(@"Accessible Object role: '%@', title: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.title, self.description, self.value, NSStringFromRect(self.rect));
NSLog(@" Children: %ld", [[self childList] count]);
}
@@ -282,7 +286,7 @@ bool testHierarchy(QWidget *w)
TestAXObject *focusButton2 = [[TestAXObject alloc] initWithAXUIElementRef: focussedElement];
EXPECT([[focusButton2 role] isEqualToString: NSAccessibilityButtonRole]);
- EXPECT([[focusButton2 description] isEqualToString: @"Button 2"]);
+ EXPECT([[focusButton2 title] isEqualToString: @"Button 2"]);
button1->setFocus();
@@ -292,7 +296,7 @@ bool testHierarchy(QWidget *w)
EXPECT(focussedElement);
TestAXObject *focusButton1 = [[TestAXObject alloc] initWithAXUIElementRef: focussedElement];
EXPECT([[focusButton1 role] isEqualToString: NSAccessibilityButtonRole]);
- EXPECT([[focusButton1 description] isEqualToString: @"I am a button"]);
+ EXPECT([[focusButton1 title] isEqualToString: @"I am a button"]);
return true;
}