Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 252d03c in mainline for uspace/lib/ui/test/window.c


Ignore:
Timestamp:
2021-04-28T09:22:39Z (7 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
7470d97
Parents:
de227aba
Message:

Popping up a message, in text mode as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/test/window.c

    rde227aba r252d03c  
    178178}
    179179
     180/** ui_window_get_active */
     181PCUT_TEST(get_active)
     182{
     183        errno_t rc;
     184        ui_t *ui = NULL;
     185        ui_wnd_params_t params;
     186        ui_window_t *window1 = NULL;
     187        ui_window_t *window2 = NULL;
     188        ui_window_t *awnd;
     189
     190        rc = ui_create_cons(NULL, &ui);
     191        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     192
     193        awnd = ui_window_get_active(ui);
     194        PCUT_ASSERT_NULL(awnd);
     195
     196        ui_wnd_params_init(&params);
     197        params.caption = "Hello";
     198
     199        rc = ui_window_create(ui, &params, &window1);
     200        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     201        PCUT_ASSERT_NOT_NULL(window1);
     202
     203        awnd = ui_window_get_active(ui);
     204        PCUT_ASSERT_EQUALS(window1, awnd);
     205
     206        rc = ui_window_create(ui, &params, &window2);
     207        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     208        PCUT_ASSERT_NOT_NULL(window2);
     209
     210        awnd = ui_window_get_active(ui);
     211        PCUT_ASSERT_EQUALS(window2, awnd);
     212
     213        ui_window_destroy(window2);
     214
     215        awnd = ui_window_get_active(ui);
     216        PCUT_ASSERT_EQUALS(window1, awnd);
     217
     218        ui_window_destroy(window1);
     219
     220        awnd = ui_window_get_active(ui);
     221        PCUT_ASSERT_NULL(awnd);
     222
     223        ui_destroy(ui);
     224}
     225
    180226/** ui_window_resize */
    181227PCUT_TEST(resize)
Note: See TracChangeset for help on using the changeset viewer.