Changeset 3a6d44b7 in mainline for uspace/lib/wndmgt/test/wndmgt.c


Ignore:
Timestamp:
2022-11-07T17:42:51Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
60ebe63
Parents:
f1f433d
Message:

Activate window by pushing window button on taskbar

Note that with multiple seats, one would need to know which seat pushed
the button and set the appropriate focus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/wndmgt/test/wndmgt.c

    rf1f433d r3a6d44b7  
    4848static errno_t test_get_window_list(void *, wndmgt_window_list_t **);
    4949static errno_t test_get_window_info(void *, sysarg_t, wndmgt_window_info_t **);
    50 static errno_t test_activate_window(void *, sysarg_t);
     50static errno_t test_activate_window(void *, sysarg_t, sysarg_t);
    5151static errno_t test_close_window(void *, sysarg_t);
    5252static errno_t test_get_event(void *, wndmgt_ev_t *);
     
    8888
    8989        bool activate_window_called;
     90        sysarg_t activate_window_seat_id;
    9091        sysarg_t activate_window_wnd_id;
    9192
     
    302303        service_id_t sid;
    303304        wndmgt_t *wndmgt = NULL;
     305        sysarg_t seat_id;
    304306        sysarg_t wnd_id;
    305307        test_response_t resp;
     
    318320        PCUT_ASSERT_NOT_NULL(wndmgt);
    319321
     322        seat_id = 13;
    320323        wnd_id = 42;
    321324        resp.rc = ENOMEM;
    322325        resp.activate_window_called = false;
    323326
    324         rc = wndmgt_activate_window(wndmgt, wnd_id);
     327        rc = wndmgt_activate_window(wndmgt, seat_id, wnd_id);
    325328        PCUT_ASSERT_TRUE(resp.activate_window_called);
     329        PCUT_ASSERT_INT_EQUALS(seat_id, resp.activate_window_seat_id);
    326330        PCUT_ASSERT_INT_EQUALS(wnd_id, resp.activate_window_wnd_id);
    327331        PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
     
    338342        service_id_t sid;
    339343        wndmgt_t *wndmgt = NULL;
     344        sysarg_t seat_id;
    340345        sysarg_t wnd_id;
    341346        test_response_t resp;
     
    354359        PCUT_ASSERT_NOT_NULL(wndmgt);
    355360
     361        seat_id = 13;
    356362        wnd_id = 42;
    357363        resp.rc = EOK;
    358364        resp.activate_window_called = false;
    359365
    360         rc = wndmgt_activate_window(wndmgt, wnd_id);
     366        rc = wndmgt_activate_window(wndmgt, seat_id, wnd_id);
    361367        PCUT_ASSERT_TRUE(resp.activate_window_called);
     368        PCUT_ASSERT_INT_EQUALS(seat_id, resp.activate_window_seat_id);
    362369        PCUT_ASSERT_INT_EQUALS(wnd_id, resp.activate_window_wnd_id);
    363370        PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
     
    666673}
    667674
    668 static errno_t test_activate_window(void *arg, sysarg_t wnd_id)
     675static errno_t test_activate_window(void *arg, sysarg_t seat_id,
     676    sysarg_t wnd_id)
    669677{
    670678        test_response_t *resp = (test_response_t *) arg;
    671679
    672680        resp->activate_window_called = true;
     681        resp->activate_window_seat_id = seat_id;
    673682        resp->activate_window_wnd_id = wnd_id;
    674683        return resp->rc;
Note: See TracChangeset for help on using the changeset viewer.