Index: uspace/lib/ui/test/filelist.c
===================================================================
--- uspace/lib/ui/test/filelist.c	(revision fdf55a3c204ba982dec2e1272d1633955a396f19)
+++ uspace/lib/ui/test/filelist.c	(revision bb4ba929aaa2c6657c0adbc6627c17b869af4fd1)
@@ -34,4 +34,5 @@
 #include <ui/ui.h>
 #include <ui/filelist.h>
+#include <ui/scrollbar.h>
 #include <vfs/vfs.h>
 #include "../private/filelist.h"
@@ -62,11 +63,25 @@
 PCUT_TEST(create_destroy)
 {
-	ui_file_list_t *flist;
-	errno_t rc;
-
-	rc = ui_file_list_create(NULL, true, &flist);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	ui_file_list_destroy(flist);
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -74,9 +89,21 @@
 PCUT_TEST(set_cb)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	errno_t rc;
 	test_resp_t resp;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -86,4 +113,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -91,5 +120,30 @@
 PCUT_TEST(entry_height)
 {
-	// XXX
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	errno_t rc;
+	gfx_coord_t height;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Font height is 13, padding: 2 (top) + 2 (bottom) */
+	height = ui_file_list_entry_height(flist);
+	PCUT_ASSERT_INT_EQUALS(17, height);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -163,9 +217,21 @@
 PCUT_TEST(ctl)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_control_t *control;
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -174,4 +240,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -179,4 +247,7 @@
 PCUT_TEST(kbd_event)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_evclaim_t claimed;
@@ -186,5 +257,14 @@
 	/* Active file list should claim events */
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -201,5 +281,14 @@
 	/* Inactive file list should not claim events */
 
-	rc = ui_file_list_create(NULL, false, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, false, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -213,4 +302,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -242,5 +333,5 @@
 	rect.p0.x = 10;
 	rect.p0.y = 20;
-	rect.p1.x = 30;
+	rect.p1.x = 50;
 	rect.p1.y = 220;
 
@@ -301,9 +392,21 @@
 PCUT_TEST(set_rect)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	gfx_rect_t rect;
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -320,4 +423,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -346,5 +451,5 @@
 	rect.p0.x = 10;
 	rect.p0.y = 20;
-	rect.p1.x = 30;
+	rect.p1.x = 50;
 	rect.p1.y = 220;
 
@@ -359,8 +464,152 @@
 }
 
-/** ui_file_list_inside_rect() ... */
+/** ui_file_list_inside_rect() gives correct interior rectangle */
 PCUT_TEST(inside_rect)
 {
-	// XXX
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	gfx_rect_t rect;
+	gfx_rect_t irect;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 10;
+	rect.p0.y = 20;
+	rect.p1.x = 50;
+	rect.p1.y = 220;
+
+	ui_file_list_set_rect(flist, &rect);
+
+	ui_file_list_inside_rect(flist, &irect);
+	PCUT_ASSERT_INT_EQUALS(10 + 2, irect.p0.x);
+	PCUT_ASSERT_INT_EQUALS(20 + 2, irect.p0.y);
+	PCUT_ASSERT_INT_EQUALS(50 - 2 - 23, irect.p1.x);
+	PCUT_ASSERT_INT_EQUALS(220 - 2, irect.p1.y);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+/** ui_file_list_scrollbar_rect() gives correct scrollbar rectangle */
+PCUT_TEST(scrollbar_rect)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	gfx_rect_t rect;
+	gfx_rect_t srect;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 10;
+	rect.p0.y = 20;
+	rect.p1.x = 50;
+	rect.p1.y = 220;
+
+	ui_file_list_set_rect(flist, &rect);
+
+	ui_file_list_scrollbar_rect(flist, &srect);
+	PCUT_ASSERT_INT_EQUALS(50 - 2 - 23, srect.p0.x);
+	PCUT_ASSERT_INT_EQUALS(20 + 2, srect.p0.y);
+	PCUT_ASSERT_INT_EQUALS(50 - 2, srect.p1.x);
+	PCUT_ASSERT_INT_EQUALS(220 - 2, srect.p1.y);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+/** ui_file_list_scrollbar_update() updates scrollbar position */
+PCUT_TEST(scrollbar_update)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	gfx_rect_t rect;
+	ui_file_list_entry_attr_t attr;
+	ui_file_list_entry_t *entry;
+	gfx_coord_t pos;
+	gfx_coord_t move_len;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 0;
+	rect.p0.y = 0;
+	rect.p1.x = 50;
+	rect.p1.y = 38;
+
+	ui_file_list_set_rect(flist, &rect);
+
+	ui_file_list_entry_attr_init(&attr);
+	attr.name = "a";
+	attr.size = 1;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "b";
+	attr.size = 2;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "c";
+	attr.size = 3;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	entry = ui_file_list_next(ui_file_list_first(flist));
+
+	flist->cursor = entry;
+	flist->cursor_idx = 1;
+	flist->page = entry;
+	flist->page_idx = 1;
+
+	ui_file_list_scrollbar_update(flist);
+
+	/* Now scrollbar thumb should be all the way down */
+	move_len = ui_scrollbar_move_length(flist->scrollbar);
+	pos = ui_scrollbar_get_pos(flist->scrollbar);
+	PCUT_ASSERT_INT_EQUALS(move_len, pos);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -368,16 +617,30 @@
 PCUT_TEST(is_active)
 {
-	ui_file_list_t *flist;
-	errno_t rc;
-
-	rc = ui_file_list_create(NULL, true, &flist);
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 	PCUT_ASSERT_TRUE(ui_file_list_is_active(flist));
 	ui_file_list_destroy(flist);
 
-	rc = ui_file_list_create(NULL, false, &flist);
+	rc = ui_file_list_create(window, false, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 	PCUT_ASSERT_FALSE(ui_file_list_is_active(flist));
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -446,9 +709,21 @@
 PCUT_TEST(entry_append)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_attr_t attr;
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -470,4 +745,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -475,4 +752,7 @@
 PCUT_TEST(entry_delete)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_t *entry;
@@ -480,5 +760,14 @@
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -506,4 +795,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -511,9 +802,21 @@
 PCUT_TEST(clear_entries)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_attr_t attr;
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -535,4 +838,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -540,4 +845,7 @@
 PCUT_TEST(read_dir)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_t *entry;
@@ -569,5 +877,14 @@
 	PCUT_ASSERT_INT_EQUALS(0, rv);
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -595,4 +912,6 @@
 
 	free(fname);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -688,4 +1007,7 @@
 PCUT_TEST(sort)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_t *entry;
@@ -693,5 +1015,14 @@
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -729,4 +1060,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -734,4 +1067,7 @@
 PCUT_TEST(entry_ptr_cmp)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_t *a, *b;
@@ -740,5 +1076,14 @@
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -773,4 +1118,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -778,4 +1125,7 @@
 PCUT_TEST(first)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_t *entry;
@@ -783,5 +1133,14 @@
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -816,4 +1175,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -821,4 +1182,7 @@
 PCUT_TEST(last)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_t *entry;
@@ -826,5 +1190,14 @@
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -861,4 +1234,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -866,4 +1241,7 @@
 PCUT_TEST(next)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_t *entry;
@@ -871,5 +1249,14 @@
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -905,4 +1292,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -910,4 +1299,7 @@
 PCUT_TEST(prev)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	ui_file_list_entry_t *entry;
@@ -915,5 +1307,14 @@
 	errno_t rc;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -949,4 +1350,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -1021,7 +1424,94 @@
 }
 
-/** ui_file_list_cursor_move() ... */
+/** ui_file_list_cursor_move() moves cursor and scrolls */
 PCUT_TEST(cursor_move)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	ui_file_list_entry_attr_t attr;
+	gfx_rect_t rect;
+	errno_t rc;
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 0;
+	rect.p0.y = 0;
+	rect.p1.x = 10;
+	rect.p1.y = 38; /* Assuming this makes page size 2 */
+	ui_file_list_set_rect(flist, &rect);
+
+	PCUT_ASSERT_INT_EQUALS(2, ui_file_list_page_size(flist));
+
+	/* Add tree entries (more than page size, which is 2) */
+
+	ui_file_list_entry_attr_init(&attr);
+
+	attr.name = "a";
+	attr.size = 1;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "b";
+	attr.size = 2;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "c";
+	attr.size = 3;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Cursor to the last entry and page start to the next-to-last entry */
+	flist->cursor = ui_file_list_last(flist);
+	flist->cursor_idx = 2;
+	flist->page = ui_file_list_prev(flist->cursor);
+	flist->page_idx = 1;
+
+	/* Move cursor one entry up */
+	ui_file_list_cursor_move(flist, ui_file_list_prev(flist->cursor),
+	    flist->cursor_idx - 1);
+
+	/* Cursor and page start should now both be at the second entry */
+	PCUT_ASSERT_STR_EQUALS("b", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(2, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor_idx);
+	PCUT_ASSERT_EQUALS(flist->cursor, flist->page);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page_idx);
+
+	/* Move cursor to the first entry. This should scroll up. */
+	ui_file_list_cursor_move(flist, ui_file_list_first(flist), 0);
+
+	/* Cursor and page start should now both be at the first entry */
+	PCUT_ASSERT_STR_EQUALS("a", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->cursor_idx);
+	PCUT_ASSERT_EQUALS(flist->cursor, flist->page);
+	PCUT_ASSERT_INT_EQUALS(0, flist->page_idx);
+
+	/* Move cursor to the last entry. */
+	ui_file_list_cursor_move(flist, ui_file_list_last(flist), 2);
+
+	/* Cursor should be on the last entry and page on the next to last */
+	PCUT_ASSERT_STR_EQUALS("c", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(3, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(2, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("b", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(2, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page_idx);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -1036,5 +1526,4 @@
 	gfx_rect_t rect;
 	errno_t rc;
-
 	rc = ui_create_disp(NULL, &ui);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
@@ -1559,6 +2048,472 @@
 }
 
-/** ui_file_list_open() opens a directory entry */
-PCUT_TEST(open)
+/** ui_file_list_scroll_up() scrolls up by one row */
+PCUT_TEST(scroll_up)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	ui_file_list_entry_attr_t attr;
+	gfx_rect_t rect;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 0;
+	rect.p0.y = 0;
+	rect.p1.x = 10;
+	rect.p1.y = 38; /* Assuming this makes page size 2 */
+	ui_file_list_set_rect(flist, &rect);
+
+	PCUT_ASSERT_INT_EQUALS(2, ui_file_list_page_size(flist));
+
+	/* Add tree entries (more than page size, which is 2) */
+
+	ui_file_list_entry_attr_init(&attr);
+
+	attr.name = "a";
+	attr.size = 1;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "b";
+	attr.size = 2;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "c";
+	attr.size = 3;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Cursor to the last entry, page to the second */
+	flist->cursor = ui_file_list_last(flist);
+	flist->cursor_idx = 2;
+	flist->page = ui_file_list_prev(flist->cursor);
+	flist->page_idx = 1;
+
+	/* Scroll one entry up */
+	ui_file_list_scroll_up(flist);
+
+	/* Page should start on the first entry, cursor unchanged */
+	PCUT_ASSERT_STR_EQUALS("c", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(3, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(2, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("a", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->page_idx);
+
+	/* Try scrolling one more entry up */
+	ui_file_list_scroll_up(flist);
+
+	/* We were at the beginning, so nothing should have changed  */
+	PCUT_ASSERT_STR_EQUALS("c", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(3, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(2, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("a", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->page_idx);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+/** ui_file_list_scroll_down() scrolls down by one row */
+PCUT_TEST(scroll_down)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	ui_file_list_entry_attr_t attr;
+	gfx_rect_t rect;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 0;
+	rect.p0.y = 0;
+	rect.p1.x = 10;
+	rect.p1.y = 38; /* Assuming this makes page size 2 */
+	ui_file_list_set_rect(flist, &rect);
+
+	PCUT_ASSERT_INT_EQUALS(2, ui_file_list_page_size(flist));
+
+	/* Add tree entries (more than page size, which is 2) */
+
+	ui_file_list_entry_attr_init(&attr);
+
+	attr.name = "a";
+	attr.size = 1;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "b";
+	attr.size = 2;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "c";
+	attr.size = 3;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Cursor and page start to the first entry */
+	flist->cursor = ui_file_list_first(flist);
+	flist->cursor_idx = 0;
+	flist->page = flist->cursor;
+	flist->page_idx = 0;
+
+	/* Scroll one entry down */
+	ui_file_list_scroll_down(flist);
+
+	/* Page should start on the second entry, cursor unchanged */
+	PCUT_ASSERT_STR_EQUALS("a", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("b", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(2, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page_idx);
+
+	/* Try scrolling one more entry down */
+	ui_file_list_scroll_down(flist);
+
+	/* We were at the end, so nothing should have changed  */
+	PCUT_ASSERT_STR_EQUALS("a", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("b", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(2, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page_idx);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+/** ui_file_list_scroll_page_up() scrolls up by one page */
+PCUT_TEST(scroll_page_up)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	ui_file_list_entry_attr_t attr;
+	gfx_rect_t rect;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 0;
+	rect.p0.y = 0;
+	rect.p1.x = 10;
+	rect.p1.y = 38; /* Assuming this makes page size 2 */
+	ui_file_list_set_rect(flist, &rect);
+
+	PCUT_ASSERT_INT_EQUALS(2, ui_file_list_page_size(flist));
+
+	/* Add five entries (more than twice the page size, which is 2) */
+
+	ui_file_list_entry_attr_init(&attr);
+
+	attr.name = "a";
+	attr.size = 1;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "b";
+	attr.size = 2;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "c";
+	attr.size = 3;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "d";
+	attr.size = 4;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "e";
+	attr.size = 5;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Cursor to the last entry, page to the second last */
+	flist->cursor = ui_file_list_last(flist);
+	flist->cursor_idx = 4;
+	flist->page = ui_file_list_prev(flist->cursor);
+	flist->page_idx = 3;
+
+	/* Scroll one page up */
+	ui_file_list_scroll_page_up(flist);
+
+	/* Page should start on 'b', cursor unchanged */
+	PCUT_ASSERT_STR_EQUALS("e", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(5, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(4, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("b", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(2, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page_idx);
+
+	/* Page up again */
+	ui_file_list_scroll_page_up(flist);
+
+	/* Page should now be at the beginning, cursor unchanged */
+	PCUT_ASSERT_STR_EQUALS("e", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(5, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(4, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("a", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->page_idx);
+
+	/* Page up again */
+	ui_file_list_scroll_page_up(flist);
+
+	/* We were at the beginning, nothing should have changed */
+	PCUT_ASSERT_STR_EQUALS("e", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(5, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(4, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("a", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->page_idx);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+/** ui_file_list_scroll_page_up() scrolls down by one page */
+PCUT_TEST(scroll_page_down)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	ui_file_list_entry_attr_t attr;
+	gfx_rect_t rect;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 0;
+	rect.p0.y = 0;
+	rect.p1.x = 10;
+	rect.p1.y = 38; /* Assuming this makes page size 2 */
+	ui_file_list_set_rect(flist, &rect);
+
+	PCUT_ASSERT_INT_EQUALS(2, ui_file_list_page_size(flist));
+
+	/* Add five entries (more than twice the page size, which is 2) */
+
+	ui_file_list_entry_attr_init(&attr);
+
+	attr.name = "a";
+	attr.size = 1;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "b";
+	attr.size = 2;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "c";
+	attr.size = 3;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "d";
+	attr.size = 4;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "e";
+	attr.size = 5;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Cursor and page to the first entry */
+	flist->cursor = ui_file_list_first(flist);
+	flist->cursor_idx = 0;
+	flist->page = ui_file_list_first(flist);
+	flist->page_idx = 0;
+
+	/* Scroll one page down */
+	ui_file_list_scroll_page_down(flist);
+
+	/* Page should start on 'c', cursor unchanged */
+	PCUT_ASSERT_STR_EQUALS("a", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("c", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(3, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(2, flist->page_idx);
+
+	/* Page down again */
+	ui_file_list_scroll_page_down(flist);
+
+	/* Page should now start at 'd', cursor unchanged */
+	PCUT_ASSERT_STR_EQUALS("a", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("d", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(4, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(3, flist->page_idx);
+
+	/* Page down again */
+	ui_file_list_scroll_page_down(flist);
+
+	/* We were at the end, nothing should have changed */
+	PCUT_ASSERT_STR_EQUALS("a", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("d", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(4, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(3, flist->page_idx);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+PCUT_TEST(scroll_pos)
+{
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	ui_file_list_entry_attr_t attr;
+	gfx_rect_t rect;
+	errno_t rc;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rect.p0.x = 0;
+	rect.p0.y = 0;
+	rect.p1.x = 10;
+	rect.p1.y = 38; /* Assuming this makes page size 2 */
+	ui_file_list_set_rect(flist, &rect);
+
+	PCUT_ASSERT_INT_EQUALS(2, ui_file_list_page_size(flist));
+
+	/* Add five entries (more than twice the page size, which is 2) */
+
+	ui_file_list_entry_attr_init(&attr);
+
+	attr.name = "a";
+	attr.size = 1;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "b";
+	attr.size = 2;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "c";
+	attr.size = 3;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "d";
+	attr.size = 4;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	attr.name = "e";
+	attr.size = 5;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Cursor and page to the first entry */
+	flist->cursor = ui_file_list_first(flist);
+	flist->cursor_idx = 0;
+	flist->page = ui_file_list_first(flist);
+	flist->page_idx = 0;
+
+	/* Scroll to entry 1 (one down) */
+	ui_file_list_scroll_pos(flist, 1);
+
+	/* Page should start on 'b', cursor unchanged */
+	PCUT_ASSERT_STR_EQUALS("a", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("b", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(2, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(1, flist->page_idx);
+
+	/* Scroll to entry 3 (i.e. the end) */
+	ui_file_list_scroll_pos(flist, 3);
+
+	/* Page should now start at 'd', cursor unchanged */
+	PCUT_ASSERT_STR_EQUALS("a", flist->cursor->name);
+	PCUT_ASSERT_INT_EQUALS(1, flist->cursor->size);
+	PCUT_ASSERT_INT_EQUALS(0, flist->cursor_idx);
+	PCUT_ASSERT_STR_EQUALS("d", flist->page->name);
+	PCUT_ASSERT_INT_EQUALS(4, flist->page->size);
+	PCUT_ASSERT_INT_EQUALS(3, flist->page_idx);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
+}
+
+/** ui_file_list_open_dir() opens a directory entry */
+PCUT_TEST(open_dir)
 {
 	ui_t *ui;
@@ -1615,5 +2570,5 @@
 	PCUT_ASSERT_TRUE(entry->isdir);
 
-	rc = ui_file_list_open(flist, entry);
+	rc = ui_file_list_open_dir(flist, entry);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -1633,10 +2588,46 @@
 }
 
-PCUT_TEST(open_dir)
-{
-}
-
+/** ui_file_list_open_file() runs selected callback */
 PCUT_TEST(open_file)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
+	ui_file_list_t *flist;
+	ui_file_list_entry_attr_t attr;
+	errno_t rc;
+	test_resp_t resp;
+
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_file_list_set_cb(flist, &test_cb, &resp);
+
+	attr.name = "hello.txt";
+	attr.size = 1;
+	rc = ui_file_list_entry_append(flist, &attr);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	resp.selected = false;
+	resp.selected_file_list = NULL;
+	resp.selected_fname = NULL;
+
+	ui_file_list_open_file(flist, ui_file_list_first(flist));
+	PCUT_ASSERT_TRUE(resp.selected);
+	PCUT_ASSERT_EQUALS(flist, resp.selected_file_list);
+	PCUT_ASSERT_STR_EQUALS("hello.txt", resp.selected_fname);
+
+	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -1644,9 +2635,21 @@
 PCUT_TEST(activate_req)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	errno_t rc;
 	test_resp_t resp;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -1661,4 +2664,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
@@ -1666,9 +2671,21 @@
 PCUT_TEST(selected)
 {
+	ui_t *ui;
+	ui_window_t *window;
+	ui_wnd_params_t params;
 	ui_file_list_t *flist;
 	errno_t rc;
 	test_resp_t resp;
 
-	rc = ui_file_list_create(NULL, true, &flist);
+	rc = ui_create_disp(NULL, &ui);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ui_wnd_params_init(&params);
+	params.caption = "Test";
+
+	rc = ui_window_create(ui, &params, &window);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ui_file_list_create(window, true, &flist);
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -1685,4 +2702,6 @@
 
 	ui_file_list_destroy(flist);
+	ui_window_destroy(window);
+	ui_destroy(ui);
 }
 
