~ubuntu-x-swat/xorg-server/xsmoke

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash

. $(dirname $0)/lib/xsmoke.lib

if [ -e "$HOME/Examples/Experience ubuntu.ogg" ] ; then
    MOVIE="$HOME/Examples/Experience ubuntu.ogg"
elif [ -e "$HOME/Examples/Ubuntu_Free_Culture_Showcase/StopMotionUbuntu.ogv" ] ; then
    MOVIE="$HOME/Examples/Ubuntu_Free_Culture_Showcase/StopMotionUbuntu.ogv"
fi

if [ "$1" = "prerequisites" ] ; then
    is_installed "totem" "run totem video test" || exit 1
    [ -e "$MOVIE" ] || exit 1
    exit 0
fi


RUNTIME=20
INT=1
WNAME=$(basename $MOVIE)

totem "$MOVIE" &
PID=$!

for i in $(seq 1 $INT $RUNTIME); do
    test_count=$(( $test_count + 1 ))

    sleep $INT
    x=$(( $i * 25 ))
    y=$x
    wmctrl -r $WNAME -e 0,$x,$y,-1,-1
    if [ $? = 0 ]; then
        pass "Moved totem window"
    else
        fail "Totem window could not be moved successfully"
    fi

done

# Close totem gracefully
test_count=$(( $test_count + 1 ))
wmctrl -c $WNAME
if [ $? = 0 ]; then
    pass "Closed totem window"
else
    fail "Problem encountered closing totem window"
fi


echo "Completed all tests"
if [ "${1%.json}" != "$1" ] ; then
    JSON=$1
    json_test_summary > $JSON
else
    print_test_summary
fi