From 5d944e3c1a3f0f41f17df47676c58e0c3a909f38 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 14 May 2017 16:46:33 -0400 Subject: [PATCH] tests: Add client self-resizing support to the tests --- tests/test-maximize.lua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/test-maximize.lua b/tests/test-maximize.lua index 5c459f3e..48fc01f7 100644 --- a/tests/test-maximize.lua +++ b/tests/test-maximize.lua @@ -203,8 +203,28 @@ local steps = { function() if #client.get() > 0 then return end - -- Remove the default handler and replace it with a testing one - -- **WARNING**, add test **BEFORE** this function if you want them + -- Test if resizing requests work + test_client(nil,nil,nil,nil,nil,{resize={width=400, height=400}}) + + return true + end, + function() + if #client.get() ~= 1 then return end + + local c = client.get()[1] + local _, size = c:titlebar_top() + + if c.width ~= 400 or c.height ~= 400+size then return end + + c:kill() + + return true + end, + function() + if #client.get() > 0 then return end + + -- Remove the default handler and replace it with a testing one. + -- **WARNING**: add tests **BEFORE** this function if you want them -- to be relevant. client.disconnect_signal("request::geometry", awful.ewmh.geometry) client.disconnect_signal("request::geometry", awful.ewmh.merge_maximization)