diff options
author | Yu-Ping Wu <yupingso@chromium.org> | 2020-06-09 17:07:14 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-23 04:29:53 +0000 |
commit | be49fbfdf0b08df8e8a840aad1b91b4a7b6010db (patch) | |
tree | 9aa7c833df6ae2ae153820e4a9a58f0d194cf39b /tests | |
parent | 23f72259612eccc4557ee7e2c40f3ea2fabf9c11 (diff) | |
download | vboot-be49fbfdf0b08df8e8a840aad1b91b4a7b6010db.tar.gz |
vboot/ui: add power off options
Add power off options to screens.
BRANCH=none
BUG=b:146399181, b:145098577
TEST=make runtests
TEST=USE="menu_ui" emerge-nami depthcharge
Cq-Depend: chromium:2237367
Change-Id: I356c56361a4282b456c3a4661e518a84944e983b
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2237366
Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vb2_ui_tests.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/vb2_ui_tests.c b/tests/vb2_ui_tests.c index 676f16fa..407a081f 100644 --- a/tests/vb2_ui_tests.c +++ b/tests/vb2_ui_tests.c @@ -694,6 +694,17 @@ static void developer_tests(void) TEST_EQ(vb2_nv_get(ctx, VB2_NV_DISABLE_DEV_REQUEST), 0, " disable dev request"); + /* Power off */ + reset_common_data(FOR_DEVELOPER); + add_mock_vbtlk(VB2_SUCCESS, VB_DISK_FLAG_FIXED); + /* Navigate to the bottom most menu item */ + add_mock_keypress(VB_KEY_DOWN); + add_mock_keypress(VB_KEY_DOWN); + add_mock_keypress(VB_KEY_DOWN); + add_mock_keypress(VB_KEY_ENTER); + TEST_EQ(vb2_developer_menu(ctx), VB2_REQUEST_SHUTDOWN, + "select power off"); + VB2_DEBUG("...done.\n"); } @@ -1077,7 +1088,6 @@ static void developer_screen_tests(void) add_mock_keypress(VB_KEY_ESC); add_mock_keypress(VB_KEY_DOWN); add_mock_keypress(VB_KEY_DOWN); - add_mock_keypress(VB_KEY_DOWN); /* Blocked */ TEST_EQ(vb2_developer_menu(ctx), VB2_REQUEST_SHUTDOWN, "dev mode screen"); /* #4: Advanced options */ @@ -1113,7 +1123,6 @@ static void developer_screen_tests(void) add_mock_keypress(VB_KEY_DOWN); add_mock_keypress(VB_KEY_DOWN); add_mock_keypress(VB_KEY_ENTER); - add_mock_keypress(VB_KEY_DOWN); extend_calls_until_shutdown(); TEST_EQ(vb2_developer_menu(ctx), VB2_REQUEST_SHUTDOWN, "advanced options screen"); @@ -1157,7 +1166,6 @@ static void broken_recovery_screen_tests(void) add_mock_keypress(VB_KEY_ENTER); /* End of menu */ add_mock_keypress(VB_KEY_ESC); - add_mock_keypress(VB_KEY_DOWN); /* Blocked */ extend_calls_until_shutdown(); TEST_EQ(vb2_broken_recovery_menu(ctx), VB2_REQUEST_SHUTDOWN, "broken screen"); @@ -1190,7 +1198,6 @@ static void broken_recovery_screen_tests(void) add_mock_keypress(VB_KEY_ENTER); /* End of menu */ add_mock_keypress(VB_KEY_ENTER); - add_mock_keypress(VB_KEY_DOWN); /* Blocked */ extend_calls_until_shutdown(); TEST_EQ(vb2_broken_recovery_menu(ctx), VB2_REQUEST_SHUTDOWN, "advanced options screen"); @@ -1239,7 +1246,6 @@ static void manual_recovery_screen_tests(void) add_mock_keypress(VB_KEY_ESC); add_mock_keypress(VB_KEY_DOWN); add_mock_keypress(VB_KEY_DOWN); - add_mock_keypress(VB_KEY_DOWN); /* Blocked */ extend_calls_until_shutdown(); TEST_EQ(vb2_manual_recovery_menu(ctx), VB2_REQUEST_SHUTDOWN, "recovery select screen"); @@ -1300,7 +1306,6 @@ static void manual_recovery_screen_tests(void) add_mock_keypress(VB_KEY_DOWN); add_mock_keypress(VB_KEY_ENTER); add_mock_keypress(VB_KEY_DOWN); - add_mock_keypress(VB_KEY_DOWN); /* Blocked */ extend_calls_until_shutdown(); TEST_EQ(vb2_manual_recovery_menu(ctx), VB2_REQUEST_SHUTDOWN, "advanced options screen"); |