summaryrefslogtreecommitdiff
path: root/tests/xdg-open/t.05-open_abs_path_html
blob: 13c410264b35e2ebfa2b6694820df575af233efd (plain)
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
#!/bin/bash

## Include utility functions.
. "$XDG_TEST_DIR/include/testassertions.sh"
. "$XDG_TEST_DIR/include/testcontrol.sh"

## Test function
FILE=testfile.html
test_open_abs_path_html() {
test_start "$FUNCNAME: open absolute path of the form '$PRE/path/file.html'"

test_init

require_notroot

## Require a running X server
assert_display

echo '<html><body>I am an HTML file!</body></html>' >"$FILE"
assert_file "$FILE"

test_procedure

assert_exit 0 xdg-open "$PRE$XDG_TEST_TMPDIR/$FILE"
assert_nostdout
assert_nostderr

assert_interactive "Did an HTML file open containing the text 'I am an HTML file!'?" y
assert_interactive "Please close any windows opened by this test." C

test_result
}

repeat_test test_open_abs_path_html 1 PRE '' 'file://'