Test that manager listen to appropriate events

This commit is contained in:
Thibault Jouan 2015-04-18 20:11:04 +00:00
parent 20cdec5fce
commit 26bac5aea9
3 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,8 @@
Feature: input events selection
Scenario: selects the appropriate input event mask for a window manager
Given uhwm is running
Then the input event mask must include StructureNotifyMask
And the input event mask must include SubstructureNotifyMask
And the input event mask must include SubstructureRedirectMask
And the input event mask must include PropertyChangeMask

View File

@ -18,3 +18,7 @@ end
Then /^the window must be focused$/ do
expect(x_focused_window_id).to eq x_window_id
end
Then /^the input event mask must include (.+)$/ do |mask|
expect(x_input_event_masks).to include mask
end

View File

@ -64,6 +64,10 @@ module Uh
Integer(`xdpyinfo`[/^focus:\s+window\s+(0x\h+)/, 1])
end
def x_input_event_masks
`xdpyinfo`[/current input event mask:\s+0x\h+([\w\s]+):/, 1].split(/\s+/).grep /Mask\z/
end
def x_key key
fail "cannot simulate X key `#{key}'" unless system "xdotool key #{key}"
end