summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-06-16 23:19:43 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-06-16 23:19:43 +0200
commit36dfb63bdf3f3297d7da53e634d6dd00b93b24d3 (patch)
tree866e94c8d27425b14bf71ec2998f8040b72dc810 /test
parent73939a927fe02052c346c17005eeb517c3e00b87 (diff)
Some primitive tests for thumbnail mode
Diffstat (limited to 'test')
-rwxr-xr-xtest/feh.i26
1 files 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();