diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-01-10 15:12:07 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-01-15 08:35:59 +0000 |
commit | b70148fde1d30add67ca6dd5ef63a37842f53f81 (patch) | |
tree | 99372799b2cd52d82210852afbc805c8121999d3 /tests/auto/client/xdgshell/tst_xdgshell.cpp | |
parent | 5698f22afbd0e6be273f31cf8b934383e7b68cdb (diff) |
Client: Test for xdg toplevel min and max size
Change-Id: I60605f494eebfde9a7737911eefe69a93041ced5
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'tests/auto/client/xdgshell/tst_xdgshell.cpp')
-rw-r--r-- | tests/auto/client/xdgshell/tst_xdgshell.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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" |