summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/effects
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-03-01 08:58:41 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-03-11 08:04:21 +0100
commit100840a4fbe4e1dbbda32b51fe75469b9341db6d (patch)
tree7e2a5cbca01f3516a8a09aea7b32eda6b449748d /tests/auto/widgets/effects
parentbea214e765effd13309f25073678c0a417538183 (diff)
Fix tst_qgraphicseffect on Wayland
If we only wait until the window is shown before testing the event delivery, we may be getting a WindowActivation event and subsequent paint event after we start testing. This can cause a shift in the paint events, so that we end up with an unexpected paint event at the end. We should wait until the window is active before we start checking the response to updates, to be sure nothing is pending on the queue still. Note that you'd expect QTest::qWaitForWindowActive() to do this, but this actually falls back to qWaitForWindowExposed() when the platform does not have WindowActivation capability. While there is no real link between WindowActivation capability and waiting for a window to be active, changing the behavior of that function would be too scary, so we just implement an explicit wait in the functions that depend on this. Task-number: QTBUG-91418 Change-Id: Iee40dcfa1377f543ea05042cc5a972270b346708 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/widgets/effects')
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index 16c4ba6058..3ea4a100bb 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -694,6 +694,7 @@ void tst_QGraphicsEffect::prepareGeometryChangeInvalidateCache()
QGraphicsView view(&scene);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QTRY_VERIFY(view.windowHandle()->isActive());
QTRY_VERIFY(item->nbPaint >= 1);
item->nbPaint = 0;