From 5bbe6747fc30e3fe00afe85795fa31819ebc5bde Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 1 Jan 2017 14:22:36 +0100 Subject: [PATCH] tests: Add calls to awesome.sync() where needed Signed-off-by: Uli Schlachter --- tests/test-awesomerc.lua | 5 +++++ tests/test-awful-widget-button.lua | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test-awesomerc.lua b/tests/test-awesomerc.lua index 9e88f955..8af7d9aa 100644 --- a/tests/test-awesomerc.lua +++ b/tests/test-awesomerc.lua @@ -58,6 +58,7 @@ local steps = { assert(not old_c.ontop) get_callback({modkey}, "t")() + awesome.sync() return true end, @@ -75,6 +76,7 @@ local steps = { assert(t.master_width_factor == 0.5) get_callback({modkey}, "l")() + awesome.sync() return true end, @@ -89,6 +91,7 @@ local steps = { assert(t.master_count == 1) get_callback({modkey, "Shift"}, "h")() + awesome.sync() return true end, @@ -104,6 +107,7 @@ local steps = { get_callback({modkey, "Control"}, "h")() get_callback({modkey, "Shift" }, "l")() + awesome.sync() return true end, @@ -118,6 +122,7 @@ local steps = { assert(t.index == 1) get_callback({modkey, }, "Right")() + awesome.sync() return true end, diff --git a/tests/test-awful-widget-button.lua b/tests/test-awful-widget-button.lua index b7051547..f6cd2c5a 100644 --- a/tests/test-awful-widget-button.lua +++ b/tests/test-awful-widget-button.lua @@ -82,6 +82,7 @@ table.insert(steps, function() awful.placement.centered(mouse) root.fake_input("button_press", 1) + awesome.sync() return true end) @@ -94,10 +95,11 @@ end) -- Test a button release table.insert(steps, function() - root.fake_input("button_release", 1) - assert(button._private.image ~= img) + root.fake_input("button_release", 1) + awesome.sync() + return true end) @@ -106,6 +108,7 @@ table.insert(steps, function() assert(button._private.image == img) root.fake_input("button_press", 1) + awesome.sync() return true end) @@ -123,6 +126,7 @@ assert(button._private.image ~= img) -- test if the button is released when the mouse move out awful.placement.right(mouse--[[, {parent = w}]]) root.fake_input("button_release", 1) +awesome.sync() return true end)