Stabilize tst_QGraphicsEffect::draw()
It's very flakey in CI: http://testresults.qt.io/grafana/goto/XZQAAPRSg What we want to test is whether Qt issues paint events in response to enabling an already enabled effect. Doing so via qWait will process both window system events and posted Qt events, and the former might include spontaneous paint events from the system that we can't control. Task-number: QTBUG-115945 Change-Id: I65e5c6a4458e77b3bd2ad700c5caf6d441f4ca53 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit ea25b3962b90154f8c6eba0951ee1c58fe873139) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
9595678cad
commit
ac2c9b21c9
@ -354,7 +354,9 @@ void tst_QGraphicsEffect::draw()
|
|||||||
|
|
||||||
// Effect is already enabled; nothing should happen.
|
// Effect is already enabled; nothing should happen.
|
||||||
effect->setEnabled(true);
|
effect->setEnabled(true);
|
||||||
QTest::qWait(50);
|
// Send only posted events, not window system events,
|
||||||
|
// so that we don't get any spontaneous paint events.
|
||||||
|
QCoreApplication::sendPostedEvents();
|
||||||
QCOMPARE(effect->numRepaints, 0);
|
QCOMPARE(effect->numRepaints, 0);
|
||||||
QCOMPARE(item->numRepaints, 0);
|
QCOMPARE(item->numRepaints, 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user