summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/qaccessibility
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-22 18:40:13 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-22 18:40:13 +0100
commitc608ec825410a9287f544a2ae3ce8154424e767d (patch)
tree39ee3d73d1e970bf808ecb9f1af8affc124199e1 /tests/auto/other/qaccessibility
parentf5c6a5d06ba7b303f2999dd7a103c29282abfaa6 (diff)
parent15a32435561a668e69764d12edfa2b5c564c6505 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
Diffstat (limited to 'tests/auto/other/qaccessibility')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp20
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);