summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2012-07-13 09:45:37 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-13 14:18:51 +0200
commitd45bc23cd519f81aff60a7a090557ca8406b6a58 (patch)
treee591c93125c3ed1677b468fa8d64f22ed0ce85d7 /tests
parent02faddca534f113e1dc42348b3a801b7ac8b65a3 (diff)
Relax the reqirement in which order events are delivered.
When the pushbutton is shown, it will generate both a ShowEvent and a StateChange with active=1 (because it is a top level window). This patch relaxes the reqirement in which order events are delivered. Ideally the order should also relied on, but I'm not sure if that is feasible due to differences among window managers across all platforms. This got provoked by codereview.qt-project.org/#change,26014 Change-Id: I96159fbb1b64f0ca8d13833d8a4c6799c655afc2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index df7588465d..fef81008a7 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -386,7 +386,8 @@ void tst_QAccessibility::eventTest()
button->show();
QAccessibleEvent showEvent(button, QAccessible::ObjectShow);
- QVERIFY_EVENT(&showEvent);
+ // some platforms might send other events first, (such as state change event active=1)
+ QVERIFY(QTestAccessibility::containsEvent(&showEvent));
button->setFocus(Qt::MouseFocusReason);
QTestAccessibility::clearEvents();
QTest::mouseClick(button, Qt::LeftButton, 0);
@@ -400,7 +401,8 @@ void tst_QAccessibility::eventTest()
button->hide();
QAccessibleEvent hideEvent(button, QAccessible::ObjectHide);
- QVERIFY_EVENT(&hideEvent);
+ // some platforms might send other events first, (such as state change event active=1)
+ QVERIFY(QTestAccessibility::containsEvent(&hideEvent));
delete button;
}
@@ -800,18 +802,20 @@ void tst_QAccessibility::mainWindowTest()
QLatin1String name = QLatin1String("I am the main window");
mw->setWindowTitle(name);
QTest::qWaitForWindowShown(mw);
+
+ // The order of events is not really that important.
QAccessibleEvent show(mw, QAccessible::ObjectShow);
- QVERIFY_EVENT(&show);
+ QVERIFY(QTestAccessibility::containsEvent(&show));
+ QAccessible::State activeState;
+ activeState.active = true;
+ QAccessibleStateChangeEvent active(mw, activeState);
+ QVERIFY(QTestAccessibility::containsEvent(&active));
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(mw);
QCOMPARE(iface->text(QAccessible::Name), name);
QCOMPARE(iface->role(), QAccessible::Window);
QVERIFY(iface->state().active);
- QAccessible::State activeState;
- activeState.active = true;
- QAccessibleStateChangeEvent active(mw, activeState);
- QVERIFY_EVENT(&active);
delete iface;
delete mw;