Changeset 17c0f5d in mainline for uspace/srv/hid/display/test/window.c
- Timestamp:
- 2023-01-05T19:28:22Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ededdc4
- Parents:
- 5d86797
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/test/window.c
r5d86797 r17c0f5d 1162 1162 } 1163 1163 1164 /** ds_window_find_alt() finds alternate window by flags */ 1165 PCUT_TEST(window_find_alt) 1166 { 1167 gfx_context_t *gc; 1168 ds_display_t *disp; 1169 ds_client_t *client; 1170 ds_seat_t *seat; 1171 ds_window_t *w0; 1172 ds_window_t *w1; 1173 ds_window_t *w2; 1174 ds_window_t *wnd; 1175 display_wnd_params_t params; 1176 errno_t rc; 1177 1178 rc = gfx_context_new(&dummy_ops, NULL, &gc); 1179 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1180 1181 rc = ds_display_create(gc, df_none, &disp); 1182 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1183 1184 rc = ds_client_create(disp, NULL, NULL, &client); 1185 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1186 1187 rc = ds_seat_create(disp, &seat); 1188 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1189 1190 display_wnd_params_init(¶ms); 1191 params.rect.p0.x = params.rect.p0.y = 0; 1192 params.rect.p1.x = params.rect.p1.y = 1; 1193 1194 rc = ds_window_create(client, ¶ms, &w0); 1195 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1196 1197 rc = ds_window_create(client, ¶ms, &w1); 1198 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1199 w1->flags |= wndf_minimized; 1200 1201 rc = ds_window_create(client, ¶ms, &w2); 1202 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1203 w2->flags |= wndf_system; 1204 1205 wnd = ds_window_find_alt(w0, wndf_minimized); 1206 PCUT_ASSERT_EQUALS(w1, wnd); 1207 1208 wnd = ds_window_find_alt(w0, wndf_system); 1209 PCUT_ASSERT_EQUALS(w2, wnd); 1210 1211 wnd = ds_window_find_alt(w0, wndf_maximized); 1212 PCUT_ASSERT_NULL(wnd); 1213 1214 ds_window_destroy(w0); 1215 ds_window_destroy(w1); 1216 ds_window_destroy(w2); 1217 ds_seat_destroy(seat); 1218 ds_client_destroy(client); 1219 ds_display_destroy(disp); 1220 } 1221 1222 /** ds_window_unfocus() switches to another window */ 1223 PCUT_TEST(window_unfocus) 1224 { 1225 gfx_context_t *gc; 1226 ds_display_t *disp; 1227 ds_client_t *client; 1228 ds_seat_t *seat; 1229 ds_window_t *w0; 1230 ds_window_t *w1; 1231 display_wnd_params_t params; 1232 errno_t rc; 1233 1234 rc = gfx_context_new(&dummy_ops, NULL, &gc); 1235 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1236 1237 rc = ds_display_create(gc, df_none, &disp); 1238 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1239 1240 rc = ds_client_create(disp, NULL, NULL, &client); 1241 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1242 1243 rc = ds_seat_create(disp, &seat); 1244 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1245 1246 display_wnd_params_init(¶ms); 1247 params.rect.p0.x = params.rect.p0.y = 0; 1248 params.rect.p1.x = params.rect.p1.y = 1; 1249 1250 rc = ds_window_create(client, ¶ms, &w1); 1251 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1252 1253 rc = ds_window_create(client, ¶ms, &w0); 1254 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 1255 1256 PCUT_ASSERT_EQUALS(w0, seat->focus); 1257 1258 ds_window_unfocus(w0); 1259 1260 PCUT_ASSERT_EQUALS(w1, seat->focus); 1261 1262 ds_window_destroy(w0); 1263 ds_window_destroy(w1); 1264 ds_seat_destroy(seat); 1265 ds_client_destroy(client); 1266 ds_display_destroy(disp); 1267 } 1268 1164 1269 static errno_t dummy_set_color(void *arg, gfx_color_t *color) 1165 1270 {
Note:
See TracChangeset
for help on using the changeset viewer.