From 36dfb63bdf3f3297d7da53e634d6dd00b93b24d3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 16 Jun 2010 23:19:43 +0200 Subject: Some primitive tests for thumbnail mode --- test/feh.i | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/test/feh.i b/test/feh.i index 6e00f88..6d41c0b 100755 --- a/test/feh.i +++ b/test/feh.i @@ -3,17 +3,11 @@ use strict; use warnings; use 5.010; -use Test::More tests => 30; -use X11::GUITest qw/ - FindWindowLike - GetWindowName - SetInputFocus - SendKeys - StartApp - WaitWindowViewable -/; +use Test::More tests => 34; +use X11::GUITest qw/:ALL/; my $win; +my ($width, $height); sub feh_start { my ($opts, $files) = @_; @@ -162,3 +156,17 @@ test_win_title($win, 'feh [11 of 100] - test/ok.png'); SendKeys('{HOM PGU}'); test_win_title($win, 'feh [96 of 100] - test/ok.png'); feh_stop(); + +$win = feh_start('--thumbnails', 'test/ok.png test/ok.gif test/ok.jpg'); +test_win_title($win, 'feh [thumbnail mode]'); +$width = (GetWindowPos($win))[2]; +is($width, 640, 'thumbnail win: Correct default size'); +MoveMouseAbs(30, 30); +ClickMouseButton(M_BTN1); +($win) = WaitWindowViewable(qr{^ok\.png$}); +ok($win, 'Thumbnail mode: Window opened'); +SetInputFocus($win); +SendKeys('x'); +sleep(0.2); +is(FindWindowLike(qr{^ok\.png$}), 0, 'Thumbnail mode: Window closed (x)'); +feh_stop(); -- cgit v1.2.3