Index: uspace/lib/ui/test/menubar.c
===================================================================
--- uspace/lib/ui/test/menubar.c	(revision 46bd63c90e62ae2887633555d123a6aa959d3b05)
+++ uspace/lib/ui/test/menubar.c	(revision 5afc1aab1cfdfe1ff186c56e8dd269294e23fdb6)
@@ -37,4 +37,6 @@
 #include <ui/window.h>
 #include "../private/menubar.h"
+#include "../private/wdecor.h"
+#include "../private/window.h"
 
 PCUT_INIT;
@@ -45,12 +47,27 @@
 PCUT_TEST(create_destroy)
 {
-	ui_menu_bar_t *mbar = NULL;
-	errno_t rc;
-
-	rc = ui_menu_bar_create(NULL, NULL, &mbar);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-	PCUT_ASSERT_NOT_NULL(mbar);
-
-	ui_menu_bar_destroy(mbar);
+	ui_t *ui = NULL;
+	ui_window_t *window = NULL;
+	ui_wnd_params_t params;
+	ui_menu_bar_t *mbar = NULL;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Hello";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(window);
+
+	rc = ui_menu_bar_create(ui, window, &mbar);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(mbar);
+
+	ui_menu_bar_destroy(mbar);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -64,9 +81,22 @@
 PCUT_TEST(ctl)
 {
+	ui_t *ui = NULL;
+	ui_window_t *window = NULL;
+	ui_wnd_params_t params;
 	ui_menu_bar_t *mbar = NULL;
 	ui_control_t *control;
 	errno_t rc;
 
-	rc = ui_menu_bar_create(NULL, NULL, &mbar);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Hello";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(window);
+
+	rc = ui_menu_bar_create(ui, window, &mbar);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 	PCUT_ASSERT_NOT_NULL(mbar);
@@ -76,4 +106,6 @@
 
 	ui_control_destroy(control);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -344,4 +376,89 @@
 }
 
+/** ui_menu_bar_select_first/last() selects first/last drop-down */
+PCUT_TEST(select_first_last)
+{
+	ui_t *ui = NULL;
+	ui_window_t *window = NULL;
+	ui_wnd_params_t params;
+	ui_menu_bar_t *mbar = NULL;
+	ui_menu_dd_t *mdd1 = NULL;
+	ui_menu_dd_t *mdd2 = NULL;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Hello";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(window);
+
+	rc = ui_menu_bar_create(ui, window, &mbar);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(mbar);
+
+	rc = ui_menu_dd_create(mbar, "Test 1", &mdd1, NULL);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(mdd1);
+
+	rc = ui_menu_dd_create(mbar, "Test 2", &mdd2, NULL);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(mdd2);
+
+	ui_menu_bar_select_first(mbar, true, 0);
+	PCUT_ASSERT_EQUALS(mdd1, mbar->selected);
+
+	ui_menu_bar_select_last(mbar, true, 0);
+	PCUT_ASSERT_EQUALS(mdd2, mbar->selected);
+
+	ui_menu_bar_destroy(mbar);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+/** ui_menu_bar_select_sysmenu() activates system menu */
+PCUT_TEST(select_sysmenu)
+{
+	ui_t *ui = NULL;
+	ui_window_t *window = NULL;
+	ui_wnd_params_t params;
+	ui_menu_bar_t *mbar = NULL;
+	ui_menu_dd_t *mdd1 = NULL;
+	ui_menu_dd_t *mdd2 = NULL;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Hello";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(window);
+
+	rc = ui_menu_bar_create(ui, window, &mbar);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(mbar);
+
+	rc = ui_menu_dd_create(mbar, "Test 1", &mdd1, NULL);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(mdd1);
+
+	rc = ui_menu_dd_create(mbar, "Test 2", &mdd2, NULL);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(mdd2);
+
+	ui_menu_bar_select_sysmenu(mbar, 0);
+	PCUT_ASSERT_TRUE(window->wdecor->sysmenu_hdl_active);
+
+	ui_menu_bar_destroy(mbar);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
 /** ui_menu_bar_activate() activates/deactivates menu bar */
 PCUT_TEST(activate_deactivate)
