From ae7b173c54c6f03d651e11b7632f0d625b195f0c Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 14 May 2017 16:45:50 -0400 Subject: [PATCH] tests: Add resizing support to the test client --- tests/_client.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/_client.lua b/tests/_client.lua index 8c592cef1..c88dd1606 100644 --- a/tests/_client.lua +++ b/tests/_client.lua @@ -40,6 +40,11 @@ local function open_window(class, title, options) if options.maximize_after then window:maximize() end + if options.resize_after_width and options.resize_after_height then + window:resize( + tonumber(options.resize_after_width), tonumber(options.resize_after_height) + ) + end end local function parse_options(options) @@ -136,10 +141,20 @@ return function(class, title, sn_rules, callback, resize_increment, args) if args.maximize_after then options = options .. "maximize_after," end + if args.resize then + options = table.concat { + options, + "resize_after_width=", + args.resize.height, ",", + "resize_after_height=", + args.resize.width, "," + } + end if args.gravity then assert(type(args.gravity)=="number","Use `lgi.Gdk.Gravity.NORTH_WEST`") options = options .. "gravity=" .. args.gravity .. "," end + local data = class .. "\n" .. title .. "\n" .. options .. "\n" local success, msg = pipe:write_all(data) assert(success, tostring(msg))