blob: 21e5bb6a7af8bc1f0ec8a41b501b1e7eb9c3b001 [file] [log] [blame]
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +01001" Tests specifically for the GUI features/options that need to be set up at
2" startup to take effect at runtime.
3
4if !has('gui') || ($DISPLAY == "" && !has('gui_running'))
5 finish
6endif
7
8source setup_gui.vim
9
10func Setup()
11 call GUISetUpCommon()
12endfunc
13
14func TearDown()
15 call GUITearDownCommon()
16endfunc
17
Bram Moolenaar24d76362017-03-04 13:32:10 +010018" Ignore the "failed to create input context" error.
19call test_ignore_error('E285')
20
21" Start the GUI now, in the foreground.
Bram Moolenaar8be2fbb2017-02-23 19:32:47 +010022gui -f
23
24func 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
38endfunc
Bram Moolenaar87748452017-03-12 17:10:33 +010039
40func Test_set_guioptions_for_M()
41 sleep 200ms
42 " Check if the 'M' option is included.
43 call assert_match('.*M.*', &guioptions)
44endfunc
45
46func Test_set_guioptions_for_p()
47 let skipped = ''
48
49 if !g:x11_based_gui
50 let skipped = g:not_supported . '''p'' of guioptions'
51 else
52 sleep 200ms
53 " Check if the 'p' option is included.
54 call assert_match('.*p.*', &guioptions)
55 endif
56
57 if !empty(skipped)
58 throw skipped
59 endif
60endfunc