Changeset 5d9403d5 in mainline for uspace/app/taskbar/test/tbsmenu.c


Ignore:
Timestamp:
2023-10-13T20:27:14Z (19 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7aa9fa1b
Parents:
788c76e3
Message:

Open start menu using Enter, fix input device ID

Pressing Enter opens start menu, but only if it is focused.
Need to fix input device ID so that the menu is opened in the
correct seat, both in case of clicking and in case a key is
pressed to open the menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskbar/test/tbsmenu.c

    r788c76e3 r5d9403d5  
    6969}
    7070
     71/** Test tbsmenu_open/close/is_open() */
     72PCUT_TEST(open_close_is_open)
     73{
     74        errno_t rc;
     75        ui_t *ui = NULL;
     76        ui_wnd_params_t params;
     77        ui_window_t *window = NULL;
     78        ui_fixed_t *fixed = NULL;
     79        tbsmenu_t *tbsmenu = NULL;
     80
     81        rc = ui_create_disp(NULL, &ui);
     82        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     83
     84        ui_wnd_params_init(&params);
     85        params.caption = "Hello";
     86
     87        rc = ui_window_create(ui, &params, &window);
     88        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     89        PCUT_ASSERT_NOT_NULL(window);
     90
     91        rc = ui_fixed_create(&fixed);
     92        ui_window_add(window, ui_fixed_ctl(fixed));
     93
     94        rc = tbsmenu_create(window, fixed, &tbsmenu);
     95        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     96
     97        PCUT_ASSERT_FALSE(tbsmenu_is_open(tbsmenu));
     98        tbsmenu_open(tbsmenu);
     99        PCUT_ASSERT_TRUE(tbsmenu_is_open(tbsmenu));
     100        tbsmenu_close(tbsmenu);
     101        PCUT_ASSERT_FALSE(tbsmenu_is_open(tbsmenu));
     102
     103        tbsmenu_destroy(tbsmenu);
     104        ui_window_destroy(window);
     105        ui_destroy(ui);
     106}
     107
    71108PCUT_EXPORT(tbsmenu);
Note: See TracChangeset for help on using the changeset viewer.