From 8b9b2dec193d3b6a3380c6f69f45a93f00239a72 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 16 Sep 2024 14:36:01 +0100 Subject: [PATCH] tests: Make tst_scaling more robust When a fractional scaling value is sent, we expect the client DPR to update, and a new frame sent to the compositor. We can't be sure that our compositor thread won't already have the new frame by the time we call surfaceCommitSpy.wait. Change-Id: Iab7d57f07e854a79e69b97631fe1b6006a061b82 Reviewed-by: Shawn Rutledge Reviewed-by: David Redondo --- tests/auto/wayland/scaling/tst_scaling.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/wayland/scaling/tst_scaling.cpp b/tests/auto/wayland/scaling/tst_scaling.cpp index b4d2995ea72..de36d34aa1d 100644 --- a/tests/auto/wayland/scaling/tst_scaling.cpp +++ b/tests/auto/wayland/scaling/tst_scaling.cpp @@ -70,6 +70,8 @@ void tst_scaling::scaledWindow() QCOMPARE(vp->m_destination, QSize(200, 200)); }); + surfaceCommitSpy.clear(); + // dynamic scale change exec([&] { QVERIFY(fractionalScale()); @@ -77,8 +79,8 @@ void tst_scaling::scaledWindow() }); QTRY_COMPARE(window.devicePixelRatio(), 2.5); QCOMPARE(window.size(), QSize(200,200)); + QTRY_VERIFY(surfaceCommitSpy.count()); - QVERIFY(surfaceCommitSpy.wait()); exec([&] { Buffer *buffer = xdgToplevel()->surface()->m_committed.buffer; QVERIFY(buffer);