diff options
Diffstat (limited to 'test/boot/cedit.c')
-rw-r--r-- | test/boot/cedit.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/boot/cedit.c b/test/boot/cedit.c index df191a09f89..5b3e9b586a6 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -226,8 +226,10 @@ BOOTSTD_TEST(cedit_cmos, UTF_CONSOLE); /* Check the cedit displays correctely */ static int cedit_render(struct unit_test_state *uts) { + struct scene_obj_menu *menu; struct video_priv *vid_priv; extern struct expo *cur_exp; + struct expo_action act; struct udevice *dev; struct scene *scn; struct expo *exp; @@ -237,9 +239,50 @@ static int cedit_render(struct unit_test_state *uts) exp = cur_exp; ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev)); ut_asserteq(ID_SCENE1, cedit_prepare(exp, &vid_priv, &scn)); + + menu = scene_obj_find(scn, ID_POWER_LOSS, SCENEOBJT_MENU); + ut_assertnonnull(menu); + ut_asserteq(ID_AC_OFF, menu->cur_item_id); + ut_assertok(expo_render(exp)); ut_asserteq(4929, video_compress_fb(uts, dev, false)); ut_assertok(video_check_copy_fb(uts, dev)); + + /* move to the second menu */ + act.type = EXPOACT_POINT_OBJ; + act.select.id = ID_POWER_LOSS; + ut_assertok(cedit_do_action(exp, scn, vid_priv, &act)); + ut_assertok(expo_render(exp)); + ut_asserteq(4986, video_compress_fb(uts, dev, false)); + + /* open the menu */ + act.type = EXPOACT_OPEN; + act.select.id = ID_POWER_LOSS; + ut_assertok(cedit_do_action(exp, scn, vid_priv, &act)); + ut_assertok(expo_render(exp)); + ut_asserteq(5393, video_compress_fb(uts, dev, false)); + + /* close the menu */ + act.type = EXPOACT_CLOSE; + act.select.id = ID_POWER_LOSS; + ut_assertok(cedit_do_action(exp, scn, vid_priv, &act)); + ut_assertok(expo_render(exp)); + ut_asserteq(4986, video_compress_fb(uts, dev, false)); + + /* open the menu again to check it looks the same */ + act.type = EXPOACT_OPEN; + act.select.id = ID_POWER_LOSS; + ut_assertok(cedit_do_action(exp, scn, vid_priv, &act)); + ut_assertok(expo_render(exp)); + ut_asserteq(5393, video_compress_fb(uts, dev, false)); + + /* close the menu */ + act.type = EXPOACT_CLOSE; + act.select.id = ID_POWER_LOSS; + ut_assertok(cedit_do_action(exp, scn, vid_priv, &act)); + ut_assertok(expo_render(exp)); + ut_asserteq(4986, video_compress_fb(uts, dev, false)); + expo_destroy(exp); cur_exp = NULL; |