diff options
author | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-09-26 10:18:30 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-28 03:17:22 +0200 |
commit | 34f0f0bf7d73a0ed31364e771b72a1401f2415ae (patch) | |
tree | c77e7edebf39237d1b8045162616c5c6c3cdb9a3 /tests/auto/qaccessibility | |
parent | eee2de6aa12ff602c9303f43d864372ca2d5cc17 (diff) |
Remove dead code from QAccessibleTabBar.
Change-Id: I084259184228beea4374e8c5370f9a21064cae26
Reviewed-on: http://codereview.qt-project.org/5526
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'tests/auto/qaccessibility')
-rw-r--r-- | tests/auto/qaccessibility/tst_qaccessibility.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index f08c8e9c30..b00a0e8372 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -564,6 +564,7 @@ void tst_QAccessibility::sliderTest() QVERIFY(iface->isValid()); QCOMPARE(iface->childCount(), 0); + QCOMPARE(iface->role(), QAccessible::Slider); QAccessibleValueInterface *valueIface = iface->valueInterface(); QVERIFY(valueIface != 0); @@ -1305,32 +1306,45 @@ void tst_QAccessibility::tabTest() // Test that the Invisible bit for the navigation buttons gets set // and cleared correctly. + QAccessibleInterface *leftButton = interface->child(0); + QCOMPARE(leftButton->role(), QAccessible::PushButton); + QVERIFY(leftButton->state() & QAccessible::Invisible); + delete leftButton; - QAccessibleInterface *child1 = interface->child(0); - QVERIFY(child1); - QVERIFY(child1->state() & QAccessible::Invisible); - - const int lots = 10; + const int lots = 5; for (int i = 0; i < lots; ++i) tabBar->addTab("Foo"); + QAccessibleInterface *child1 = interface->child(0); + QAccessibleInterface *child2 = interface->child(1); + QVERIFY(child1); + QCOMPARE(child1->role(), QAccessible::PageTab); + QVERIFY(child2); + QCOMPARE(child2->role(), QAccessible::PageTab); + QVERIFY((child1->state() & QAccessible::Invisible) == false); tabBar->hide(); + + QCoreApplication::processEvents(); + QTest::qWait(100); + QVERIFY(child1->state() & QAccessible::Invisible); tabBar->show(); tabBar->setCurrentIndex(0); // Test that sending a focus action to a tab does not select it. - interface->doAction(QAccessible::Focus, 2, QVariantList()); + child2->doAction(QAccessible::Focus, 2, QVariantList()); QCOMPARE(tabBar->currentIndex(), 0); // Test that sending a press action to a tab selects it. - interface->doAction(QAccessible::Press, 2, QVariantList()); + child2->doAction(QAccessible::Press, 2, QVariantList()); QCOMPARE(tabBar->currentIndex(), 1); delete tabBar; delete interface; + delete child1; + delete child2; QTestAccessibility::clearEvents(); } |