From 761a8713df7c768e939eeae1c922b8d7d1194d76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Sun, 19 Apr 2015 00:37:10 +0200 Subject: [PATCH] Added testcase for 'window_type' criterion when used as a command. --- testcases/t/232-cmd-move-criteria.t | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/testcases/t/232-cmd-move-criteria.t b/testcases/t/232-cmd-move-criteria.t index 22a2eb4e..48a51d56 100644 --- a/testcases/t/232-cmd-move-criteria.t +++ b/testcases/t/232-cmd-move-criteria.t @@ -18,6 +18,10 @@ # Bug still in: 4.8-16-g6888a1f use i3test; +############################################################################### +# Tets moving with 'id' criterion. +############################################################################### + my $ws = fresh_workspace; my $win1 = open_window; @@ -34,4 +38,39 @@ my $ws_con = get_ws($ws); is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with criteria'); is($x->input_focus, $win3->{id}, 'it should not disturb focus'); +############################################################################### +# Tets moving with 'window_type' criterion. +############################################################################### + +# test all window types +my %window_types = ( + 'normal' => '_NET_WM_WINDOW_TYPE_NORMAL', + 'dialog' => '_NET_WM_WINDOW_TYPE_DIALOG', + 'utility' => '_NET_WM_WINDOW_TYPE_UTILITY', + 'toolbar' => '_NET_WM_WINDOW_TYPE_TOOLBAR', + 'splash' => '_NET_WM_WINDOW_TYPE_SPLASH', + 'menu' => '_NET_WM_WINDOW_TYPE_MENU', + 'dropdown_menu' => '_NET_WM_WINDOW_TYPE_DROPDOWN_MENU', + 'popup_menu' => '_NET_WM_WINDOW_TYPE_POPUP_MENU', + 'tooltip' => '_NET_WM_WINDOW_TYPE_TOOLTIP' +); + +while (my ($window_type, $atom) = each %window_types) { + + $ws = fresh_workspace; + + $win1 = open_window(window_type => $x->atom(name => $atom)); + $win2 = open_window; + $win3 = open_window; + + cmd '[window_type="' . $window_type . '"] move right'; + + $ws_con = get_ws($ws); + is($ws_con->{nodes}[0]->{window}, $win2->{id}, 'the `move [direction]` command should work with window_type = ' . $window_type); + is($x->input_focus, $win3->{id}, 'it should not disturb focus'); + +} + +############################################################################### + done_testing; -- 2.39.2