Ignore:
Timestamp:
2022-10-31T10:53:53Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b92d4b
Parents:
7cc30e9
git-author:
Jiri Svoboda <jiri@…> (2022-10-30 10:53:48)
git-committer:
Jiri Svoboda <jiri@…> (2022-10-31 10:53:53)
Message:

Deliver WM events for windows being added and removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/test/window.c

    r7cc30e9 r913add60  
    5151};
    5252
     53/** Test creating and destroying window */
     54PCUT_TEST(create_destroy)
     55{
     56        ds_display_t *disp;
     57        ds_client_t *client;
     58        ds_seat_t *seat;
     59        ds_window_t *wnd;
     60        display_wnd_params_t params;
     61        errno_t rc;
     62
     63        rc = ds_display_create(NULL, df_none, &disp);
     64        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     65
     66        rc = ds_client_create(disp, NULL, NULL, &client);
     67        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     68
     69        rc = ds_seat_create(disp, &seat);
     70        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     71
     72        display_wnd_params_init(&params);
     73        params.rect.p0.x = params.rect.p0.y = 0;
     74        params.rect.p1.x = params.rect.p1.y = 10;
     75
     76        rc = ds_window_create(client, &params, &wnd);
     77        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     78
     79        ds_window_destroy(wnd);
     80        ds_seat_destroy(seat);
     81        ds_client_destroy(client);
     82        ds_display_destroy(disp);
     83}
     84
     85/** Test ds_window_bring_to_top() brings window to top */
     86PCUT_TEST(bring_to_top)
     87{
     88        ds_display_t *disp;
     89        ds_client_t *client;
     90        ds_seat_t *seat;
     91        ds_window_t *w1;
     92        ds_window_t *w2;
     93        display_wnd_params_t params;
     94        errno_t rc;
     95
     96        rc = ds_display_create(NULL, df_none, &disp);
     97        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     98
     99        rc = ds_client_create(disp, NULL, NULL, &client);
     100        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     101
     102        rc = ds_seat_create(disp, &seat);
     103        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     104
     105        display_wnd_params_init(&params);
     106        params.rect.p0.x = params.rect.p0.y = 0;
     107        params.rect.p1.x = params.rect.p1.y = 10;
     108
     109        rc = ds_window_create(client, &params, &w1);
     110        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     111
     112        rc = ds_window_create(client, &params, &w2);
     113        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     114
     115        /* w2 should be on the top */
     116        PCUT_ASSERT_EQUALS(w2, ds_display_first_window(disp));
     117
     118        /* Bring w1 to top */
     119        ds_window_bring_to_top(w1);
     120
     121        /* Now w1 should be on the top */
     122        PCUT_ASSERT_EQUALS(w1, ds_display_first_window(disp));
     123
     124        ds_window_destroy(w1);
     125        ds_window_destroy(w2);
     126        ds_seat_destroy(seat);
     127        ds_client_destroy(client);
     128        ds_display_destroy(disp);
     129}
     130
    53131/** Test ds_window_resize(). */
    54132PCUT_TEST(window_resize)
Note: See TracChangeset for help on using the changeset viewer.