summaryrefslogtreecommitdiffstats
path: root/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-11-15 18:32:55 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-21 15:53:16 +0100
commit6e7f08182ea9a6e0e4f89c6b13ff8dcae1d3b87c (patch)
treef21315ed7fae074c147230f101a7d5be07d2ea6b /tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp
parent6f9fb98886c592060fb8c17520c49947659d0817 (diff)
Accessibility: Clean up usage of navigate.
Prefer to use parent/child functions instead. Change-Id: Ic92165b9439eb750c9d762ddf5dcd2a5ccf0277d Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp')
-rw-r--r--tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp b/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp
index 9b2d015005..fc583d8bd8 100644
--- a/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp
@@ -172,8 +172,7 @@ static int verifyHierarchy(QAccessibleInterface *iface)
if2 = iface->child(i);
EXPECT(if2 != 0);
// navigate Ancestor...
- QAccessibleInterface *parent = 0;
- parent = if2->parent();
+ QAccessibleInterface *parent = if2->parent();
EXPECT(iface->object() == parent->object());
delete parent;
@@ -1533,8 +1532,8 @@ void tst_QAccessibility::menuTest()
QAccessibleInterface *iface2 = 0;
// traverse siblings with navigate(Sibling, ...)
- int entry = interface->navigate(QAccessible::Child, 1, &iface);
- QCOMPARE(entry, 0);
+ int entry;
+ iface = interface->child(0);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::MenuItem);
@@ -1555,8 +1554,7 @@ void tst_QAccessibility::menuTest()
delete iface;
// traverse menu items with navigate(Down, ...)
- entry = interface->navigate(QAccessible::Child, 1, &iface);
- QCOMPARE(entry, 0);
+ iface = interface->child(0);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::MenuItem);
@@ -1571,8 +1569,7 @@ void tst_QAccessibility::menuTest()
delete iface;
// traverse menu items with navigate(Up, ...)
- entry = interface->navigate(QAccessible::Child, interface->childCount(), &iface);
- QCOMPARE(entry, 0);
+ iface = interface->child(interface->childCount() - 1);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::MenuItem);
@@ -1587,13 +1584,12 @@ void tst_QAccessibility::menuTest()
delete iface;
// "New" item
- entry = interface->navigate(QAccessible::Child, 1, &iface);
- QCOMPARE(entry, 0);
+ iface = interface->child(0);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::MenuItem);
// "New" menu
- entry = iface->navigate(QAccessible::Child, 1, &iface2);
+ iface2 = iface->child(0);
delete iface;
iface = iface2;
QCOMPARE(entry, 0);
@@ -1601,10 +1597,9 @@ void tst_QAccessibility::menuTest()
QCOMPARE(iface->role(), QAccessible::PopupMenu);
// "Text file" menu item
- entry = iface->navigate(QAccessible::Child, 1, &iface2);
+ iface2 = iface->child(0);
delete iface;
iface = iface2;
- QCOMPARE(entry, 0);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::MenuItem);
@@ -1905,8 +1900,7 @@ void tst_QAccessibility::mdiSubWindowTest()
if (isSubWindowsPlacedNextToEachOther) {
// This part of the test can only be run if the sub windows are
// placed next to each other.
- QAccessibleInterface *destination = 0;
- QCOMPARE(interface->navigate(QAccessible::Child, 1, &destination), 0);
+ QAccessibleInterface *destination = interface->child(0);
QVERIFY(destination);
QCOMPARE(destination->object(), (QObject*)testWindow->widget());
delete destination;