Index: uspace/lib/ui/test/entry.c
===================================================================
--- uspace/lib/ui/test/entry.c	(revision c632c969ffb9871f32ae6c135490d77fb8a4db87)
+++ uspace/lib/ui/test/entry.c	(revision 232bf2c52c8d4572d78e81df5fe84ab28ed8ac39)
@@ -106,8 +106,21 @@
 PCUT_TEST(set_halign)
 {
-	ui_entry_t *entry;
-	errno_t rc;
-
-	rc = ui_entry_create(NULL, "Hello", &entry);
+	errno_t rc;
+	ui_t *ui = NULL;
+	ui_window_t *window = NULL;
+	ui_wnd_params_t params;
+	ui_entry_t *entry;
+
+	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_entry_create(window, "Hello", &entry);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -118,4 +131,6 @@
 
 	ui_entry_destroy(entry);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
Index: uspace/lib/ui/test/popup.c
===================================================================
--- uspace/lib/ui/test/popup.c	(revision c632c969ffb9871f32ae6c135490d77fb8a4db87)
+++ uspace/lib/ui/test/popup.c	(revision 232bf2c52c8d4572d78e81df5fe84ab28ed8ac39)
@@ -98,4 +98,6 @@
 	errno_t rc;
 	ui_t *ui = NULL;
+	ui_wnd_params_t wparams;
+	ui_window_t *window = NULL;
 	ui_popup_params_t params;
 	ui_popup_t *popup = NULL;
@@ -104,11 +106,19 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
+	ui_wnd_params_init(&wparams);
+	wparams.caption = "Hello";
+
+	rc = ui_window_create(ui, &wparams, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(window);
+
 	ui_popup_params_init(&params);
 
-	rc = ui_popup_create(ui, NULL, &params, &popup);
+	rc = ui_popup_create(ui, window, &params, &popup);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 	PCUT_ASSERT_NOT_NULL(popup);
 
 	ui_popup_destroy(popup);
+	ui_window_destroy(window);
 	ui_destroy(ui);
 }
@@ -125,4 +135,6 @@
 	errno_t rc;
 	ui_t *ui = NULL;
+	ui_wnd_params_t wparams;
+	ui_window_t *window = NULL;
 	ui_popup_params_t params;
 	ui_popup_t *popup = NULL;
@@ -133,7 +145,14 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
+	ui_wnd_params_init(&wparams);
+	wparams.caption = "Hello";
+
+	rc = ui_window_create(ui, &wparams, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(window);
+
 	ui_popup_params_init(&params);
 
-	rc = ui_popup_create(ui, NULL, &params, &popup);
+	rc = ui_popup_create(ui, window, &params, &popup);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 	PCUT_ASSERT_NOT_NULL(popup);
@@ -171,4 +190,5 @@
 
 	ui_popup_destroy(popup);
+	ui_window_destroy(window);
 	ui_destroy(ui);
 }
@@ -179,28 +199,34 @@
 	errno_t rc;
 	ui_t *ui = NULL;
-	ui_wnd_params_t params;
+	ui_wnd_params_t wparams;
 	ui_window_t *window = NULL;
+	ui_popup_params_t params;
+	ui_popup_t *popup = NULL;
 	ui_resource_t *res;
 	gfx_context_t *gc;
-	gfx_rect_t rect;
 
 	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);
+	ui_wnd_params_init(&wparams);
+	wparams.caption = "Hello";
+
+	rc = ui_window_create(ui, &wparams, &window);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 	PCUT_ASSERT_NOT_NULL(window);
 
-	res = ui_window_get_res(window);
+	ui_popup_params_init(&params);
+
+	rc = ui_popup_create(ui, window, &params, &popup);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(popup);
+
+	res = ui_popup_get_res(popup);
 	PCUT_ASSERT_NOT_NULL(res);
 
-	gc = ui_window_get_gc(window);
+	gc = ui_popup_get_gc(popup);
 	PCUT_ASSERT_NOT_NULL(gc);
 
-	ui_window_get_app_rect(window, &rect);
-
+	ui_popup_destroy(popup);
 	ui_window_destroy(window);
 	ui_destroy(ui);
@@ -212,4 +238,6 @@
 	errno_t rc;
 	ui_t *ui = NULL;
+	ui_wnd_params_t wparams;
+	ui_window_t *window = NULL;
 	ui_popup_params_t params;
 	ui_popup_t *popup = NULL;
@@ -220,7 +248,14 @@
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
+	ui_wnd_params_init(&wparams);
+	wparams.caption = "Hello";
+
+	rc = ui_window_create(ui, &wparams, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	PCUT_ASSERT_NOT_NULL(window);
+
 	ui_popup_params_init(&params);
 
-	rc = ui_popup_create(ui, NULL, &params, &popup);
+	rc = ui_popup_create(ui, window, &params, &popup);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 	PCUT_ASSERT_NOT_NULL(popup);
@@ -251,4 +286,5 @@
 
 	ui_popup_destroy(popup);
+	ui_window_destroy(window);
 	ui_destroy(ui);
 }
