diff options
Diffstat (limited to 'tests/auto/other/qaccessibility/tst_qaccessibility.cpp')
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index ea322b20a1..68fde2fd2e 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1265,14 +1265,21 @@ void tst_QAccessibility::menuTest() mw.menuBar()->addAction("Action!"); + QMenu *childOfMainWindow = new QMenu(QStringLiteral("&Tools"), &mw); + childOfMainWindow->addAction("&Options"); + mw.menuBar()->addMenu(childOfMainWindow); + mw.show(); // triggers layout QTest::qWait(100); - QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(mw.menuBar()); + QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&mw); QCOMPARE(verifyHierarchy(interface), 0); + delete interface; + + interface = QAccessible::queryAccessibleInterface(mw.menuBar()); QVERIFY(interface); - QCOMPARE(interface->childCount(), 5); + QCOMPARE(interface->childCount(), 6); QCOMPARE(interface->role(), QAccessible::MenuBar); QAccessibleInterface *iFile = interface->child(0); |