From b70148fde1d30add67ca6dd5ef63a37842f53f81 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 10 Jan 2019 15:12:07 +0100 Subject: Client: Test for xdg toplevel min and max size Change-Id: I60605f494eebfde9a7737911eefe69a93041ced5 Reviewed-by: Pier Luigi Fiorini --- tests/auto/client/xdgshell/tst_xdgshell.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/auto/client/xdgshell') diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp index 55e994b06..1bfabe55f 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -43,6 +43,7 @@ private slots: void configureStates(); void popup(); void pongs(); + void minMaxSize(); }; void tst_xdgshell::showMinimized() @@ -265,5 +266,26 @@ void tst_xdgshell::pongs() QCOMPARE(pongSpy.first().at(0).toUInt(), serial); } +void tst_xdgshell::minMaxSize() +{ + QRasterWindow window; + window.setMinimumSize(QSize(100, 100)); + window.setMaximumSize(QSize(1000, 1000)); + window.resize(400, 320); + window.show(); + QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); + + exec([=] { xdgToplevel()->sendCompleteConfigure(); }); + + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(100, 100)); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(1000, 1000)); + + window.setMaximumSize(QSize(500, 400)); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.maxSize, QSize(500, 400)); + + window.setMinimumSize(QSize(50, 40)); + QCOMPOSITOR_TRY_COMPARE(xdgToplevel()->m_committed.minSize, QSize(50, 40)); +} + QCOMPOSITOR_TEST_MAIN(tst_xdgshell) #include "tst_xdgshell.moc" -- cgit v1.2.3