patch 8.2.4228: no tests for clicking in the GUI tabline

Problem:    No tests for clicking in the GUI tabline.
Solution:   Add test functions to generate the events.  Add tests using the
            functions. (Yegappan Lakshmanan, closes #9638)
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 7bb48b8..bfb63d0 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -645,6 +645,9 @@
 				none	drop a list of files in a window
 test_gui_mouse_event({button}, {row}, {col}, {repeated}, {mods})
 				none	add a mouse event to the input buffer
+test_gui_tabline_event({tabnr}) Bool	add a tabline event to the input buffer
+test_gui_tabmenu_event({tabnr}, {event})
+				none	add a tabmenu event to the input buffer
 test_ignore_error({expr})	none	ignore a specific error
 test_null_blob()		Blob	null value for testing
 test_null_channel()		Channel	null value for testing
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index fb43fbc..e5b9134 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -121,6 +121,24 @@
 		|feedkeys()| to have them processed, e.g.: >
 			call feedkeys("y", 'Lx!')
 
+						*test_gui_tabline_event()*
+test_gui_tabline_event({tabnr})
+		Add an event that simulates a click on the tabline to select
+		tabpage {tabnr} to the input buffer.
+		Returns TRUE if the event is successfully added, FALSE if
+		already in the tabpage {tabnr} or the cmdline window is open.
+		After injecting the event you probably should call
+		|feedkeys()| to have them processed, e.g.: >
+			call feedkeys("y", 'Lx!')
+
+						*test_gui_tabmenu_event()*
+test_gui_tabmenu_event({tabnr}, {event})
+		Add an event that simulates selecting a tabline menu entry for
+		tabpage {tabnr} to the input buffer. {event} is 1 for the
+		first menu entry, 2 for the second entry and so on.
+		After injecting the event you probably should call
+		|feedkeys()| to have them processed, e.g.: >
+			call feedkeys("y", 'Lx!')
 
 test_ignore_error({expr})			 *test_ignore_error()*
 		Ignore any error containing {expr}.  A normal message is given
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 71a4850..66b267f 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1118,6 +1118,8 @@
 	test_getvalue()		get value of an internal variable
 	test_gui_drop_files()	drop file(s) in a window
 	test_gui_mouse_event()	add a GUI mouse event to the input buffer
+	test_gui_tabline_event() add a GUI tabline event to the input buffer
+	test_gui_tabmenu_event() add a GUI tabmenu event to the input buffer
 	test_ignore_error()	ignore a specific error message
 	test_null_blob()	return a null Blob
 	test_null_channel()	return a null Channel