tests: Add client self-resizing support to the tests

This commit is contained in:
Emmanuel Lepage Vallee 2017-05-14 16:46:33 -04:00 committed by Daniel Hahler
parent ae7b173c54
commit 5d944e3c1a
1 changed files with 22 additions and 2 deletions

View File

@ -203,8 +203,28 @@ local steps = {
function() function()
if #client.get() > 0 then return end if #client.get() > 0 then return end
-- Remove the default handler and replace it with a testing one -- Test if resizing requests work
-- **WARNING**, add test **BEFORE** this function if you want them 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. -- to be relevant.
client.disconnect_signal("request::geometry", awful.ewmh.geometry) client.disconnect_signal("request::geometry", awful.ewmh.geometry)
client.disconnect_signal("request::geometry", awful.ewmh.merge_maximization) client.disconnect_signal("request::geometry", awful.ewmh.merge_maximization)