Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 1 | " Tests specifically for the GUI features/options that need to be set up at |
| 2 | " startup to take effect at runtime. |
| 3 | |
| 4 | if !has('gui') || ($DISPLAY == "" && !has('gui_running')) |
| 5 | finish |
| 6 | endif |
| 7 | |
| 8 | source setup_gui.vim |
| 9 | |
| 10 | func Setup() |
| 11 | call GUISetUpCommon() |
| 12 | endfunc |
| 13 | |
| 14 | func TearDown() |
| 15 | call GUITearDownCommon() |
| 16 | endfunc |
| 17 | |
Bram Moolenaar | 24d7636 | 2017-03-04 13:32:10 +0100 | [diff] [blame] | 18 | " Ignore the "failed to create input context" error. |
| 19 | call test_ignore_error('E285') |
| 20 | |
| 21 | " Start the GUI now, in the foreground. |
Bram Moolenaar | 8be2fbb | 2017-02-23 19:32:47 +0100 | [diff] [blame] | 22 | gui -f |
| 23 | |
| 24 | func Test_set_guiheadroom() |
| 25 | let skipped = '' |
| 26 | |
| 27 | if !g:x11_based_gui |
| 28 | let skipped = g:not_supported . 'guiheadroom' |
| 29 | else |
| 30 | " The 'expected' value must be consistent with the value specified with |
| 31 | " gui_init.vim. |
| 32 | call assert_equal(0, &guiheadroom) |
| 33 | endif |
| 34 | |
| 35 | if !empty(skipped) |
| 36 | throw skipped |
| 37 | endif |
| 38 | endfunc |