Client: Add test that we always respond to configure events

Change-Id: I35ca2bb3287efa4c79f1352ebc7f5da872b2d4ce
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
This commit is contained in:
David Edmundson 2024-07-15 12:59:51 +01:00
parent b2161c6bad
commit ce176682bc

View File

@ -111,11 +111,30 @@ void tst_xdgshell::configureSize()
const QSize configureSize(60, 40);
int pendingSerial;
exec([&] {
xdgToplevel()->sendCompleteConfigure(configureSize);
pendingSerial = xdgSurface()->m_pendingConfigureSerials.last();
});
QTRY_COMPARE(configureSpy.size(), 1);
QCOMPARE(configureSpy.last()[0].toInt(), pendingSerial);
exec([&] {
Buffer *buffer = xdgToplevel()->surface()->m_committed.buffer;
QVERIFY(buffer);
QCOMPARE(buffer->size(), configureSize);
});
// clients should always respond with a new ack configure + commit
// even if nothing changed
exec([&] {
xdgToplevel()->sendCompleteConfigure(configureSize);
pendingSerial = xdgSurface()->m_pendingConfigureSerials.last();
});
QTRY_COMPARE(configureSpy.size(), 2);
QCOMPARE(configureSpy.last()[0].toInt(), pendingSerial);
exec([&] {
Buffer *buffer = xdgToplevel()->surface()->m_committed.buffer;