diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-01-23 22:12:54 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-23 22:12:54 +0100 |
commit | 7df08a8b63c8fc861a5e927eabf2405e1a2a01e1 (patch) | |
tree | 495ff2934465b02b01fc2ff694687344c909bf62 /tests/auto/other/qaccessibility/tst_qaccessibility.cpp | |
parent | 06e4b1cff4c469d2fc3afbfe7a6b1954fedc90ff (diff) | |
parent | c608ec825410a9287f544a2ae3ce8154424e767d (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/other/qaccessibility/tst_qaccessibility.cpp')
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index da727be3a4..1b718d6487 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the test suite of the Qt Toolkit. @@ -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); @@ -2458,6 +2465,12 @@ void tst_QAccessibility::listTest() void tst_QAccessibility::treeTest() { QTreeWidget *treeView = new QTreeWidget; + + // Empty model (do not crash, etc) + treeView->setColumnCount(0); + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(treeView); + QCOMPARE(iface->child(0), static_cast<QAccessibleInterface*>(0)); + treeView->setColumnCount(2); QTreeWidgetItem *header = new QTreeWidgetItem; header->setText(0, "Artist"); @@ -2493,7 +2506,6 @@ void tst_QAccessibility::treeTest() QCoreApplication::processEvents(); QTest::qWait(100); - QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(treeView); QCOMPARE(verifyHierarchy(iface), 0); QCOMPARE((int)iface->role(), (int)QAccessible::Tree); |