1" Tests specifically for the GUI features/options that need to be set up at
2" startup to take effect at runtime.
3
4source shared.vim
5if !CanRunGui()
6  throw 'Skipped: cannot run GUI'
7endif
8
9source setup_gui.vim
10
11func Setup()
12  call GUISetUpCommon()
13endfunc
14
15func TearDown()
16  call GUITearDownCommon()
17endfunc
18
19" Ignore the "failed to create input context" error.
20call test_ignore_error('E285:')
21
22" Start the GUI now, in the foreground.
23gui -f
24
25func Test_set_guiheadroom()
26  let skipped = ''
27
28  if !g:x11_based_gui
29    let skipped = g:not_supported . 'guiheadroom'
30  else
31    " The 'expected' value must be consistent with the value specified with
32    " gui_init.vim.
33    call assert_equal(0, &guiheadroom)
34  endif
35
36  if !empty(skipped)
37    throw skipped
38  endif
39endfunc
40
41func Test_set_guioptions_for_M()
42  sleep 200ms
43  " Check if the 'M' option is included.
44  call assert_match('.*M.*', &guioptions)
45endfunc
46
47func Test_set_guioptions_for_p()
48  let skipped = ''
49
50  if !g:x11_based_gui
51    let skipped = g:not_supported . '''p'' of guioptions'
52  else
53    sleep 200ms
54    " Check if the 'p' option is included.
55    call assert_match('.*p.*', &guioptions)
56  endif
57
58  if !empty(skipped)
59    throw skipped
60  endif
61endfunc
62