diff options
author | Julius Werner <jwerner@chromium.org> | 2018-02-07 15:36:41 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-02-08 01:24:36 -0800 |
commit | dff3a8544b09d54cce487b215a8713d4594c834b (patch) | |
tree | dd7b9c5072df3318c418bc41edff30ee6ac1554a /tests | |
parent | 01b50c46bcff65524adacdcce91732e682f906e2 (diff) | |
download | vboot-dff3a8544b09d54cce487b215a8713d4594c834b.tar.gz |
detachables: Allow 'Tab' to display debug info on all screens
Since we're continuing to support the boot shortcuts Ctrl+D, Ctrl+U and
Ctrl+L, it makes sense to also continue to support the debug info
shortcut Tab, just in case somebody may want to use it from an external
keyboard. This does not affect the existing method to display debug info
through the appropriate menu option in any way.
BRANCH=None
BUG=b:73080278
TEST=make runtests, booted Scarlet and pressed Tab on UART.
Change-Id: Ia08404e0ffd1f8cac3d85f3b2fc4ce17a21d743d
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/907759
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vboot_detach_menu_tests.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/vboot_detach_menu_tests.c b/tests/vboot_detach_menu_tests.c index 6ba879ec..06e2be37 100644 --- a/tests/vboot_detach_menu_tests.c +++ b/tests/vboot_detach_menu_tests.c @@ -1233,6 +1233,24 @@ static void VbBootDevTest(void) TEST_EQ(screens_count, i, " no extra screens"); TEST_EQ(beeps_count, 0, " no beeps for debug info"); + /* Pressing Tab displays debug info, then times out to boot */ + ResetMocksForDeveloper(); + i = 0; + mock_keypress[i++] = '\t'; + TEST_EQ(VbBootDeveloperMenu(&ctx), vbtlk_retval_fixed, + "Show Debug Info (Tab shortcut)"); + TEST_EQ(debug_info_displayed, 1, " debug info displayed"); + TEST_EQ(vbexlegacy_called, 0, " not legacy"); + TEST_EQ(audio_looping_calls_left, 0, " audio timed out"); + TEST_EQ(vb2_nv_get(&ctx, VB2_NV_RECOVERY_REQUEST), 0, " no recovery"); + i = 0; + TEST_EQ(screens_displayed[i++], VB_SCREEN_DEVELOPER_WARNING_MENU, + " dev warning menu: power off"); + TEST_EQ(screens_displayed[i++], VB_SCREEN_BLANK," final blank screen"); + TEST_EQ(screens_count, i, " no extra screens"); + TEST_EQ(beeps_count, 0, " no beeps for debug info"); + + printf("...done.\n"); } @@ -1510,6 +1528,40 @@ static void VbBootRecTest(void) TEST_EQ(screens_count, 4, " no extra screens"); TEST_EQ(beeps_count, 0, " no beep from power off"); + /* Show Debug Info from BROKEN through OPTIONS menu */ + ResetMocks(); + mock_keypress[0] = VB_BUTTON_VOL_UP_SHORT_PRESS; // enter options + mock_keypress[1] = VB_BUTTON_VOL_UP_SHORT_PRESS; // show debug info + mock_keypress[2] = VB_BUTTON_POWER_SHORT_PRESS; + TEST_EQ(VbBootRecoveryMenu(&ctx), VBERROR_SHUTDOWN_REQUESTED, + "Show Debug info from BROKEN through OPTIONS"); + TEST_EQ(vb2_nv_get(&ctx, VB2_NV_RECOVERY_REQUEST), 0, " no recovery"); + TEST_EQ(debug_info_displayed, 1, " no debug info"); + TEST_EQ(shutdown_request_calls_left, 0, " timed out"); + TEST_EQ(screens_displayed[0], VB_SCREEN_OS_BROKEN, + " broken screen"); + TEST_EQ(screens_displayed[1], VB_SCREEN_OPTIONS_MENU, + " options: cancel"); + TEST_EQ(screens_displayed[2], VB_SCREEN_OPTIONS_MENU, + " options: show debug info"); + TEST_EQ(screens_displayed[3], VB_SCREEN_BLANK, " final blank screen"); + TEST_EQ(screens_count, 4, " no extra screens"); + TEST_EQ(beeps_count, 0, " no beep from power off"); + + /* Show Debug Info on NOGOOD with Tab */ + ResetMocksForManualRecovery(); + mock_keypress[0] = '\t'; + TEST_EQ(VbBootRecoveryMenu(&ctx), VBERROR_SHUTDOWN_REQUESTED, + "Show Debug info on NOGOOD with Tab"); + TEST_EQ(vb2_nv_get(&ctx, VB2_NV_RECOVERY_REQUEST), 0, " no recovery"); + TEST_EQ(debug_info_displayed, 1, " no debug info"); + TEST_EQ(shutdown_request_calls_left, 0, " timed out"); + TEST_EQ(screens_displayed[0], VB_SCREEN_RECOVERY_NO_GOOD, + " nogood screen"); + TEST_EQ(screens_displayed[1], VB_SCREEN_BLANK, " final blank screen"); + TEST_EQ(screens_count, 2, " no extra screens"); + TEST_EQ(beeps_count, 0, " no beep from power off"); + /* Navigate to confirm dev mode selection and then cancel */ ResetMocksForManualRecovery(); vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE; |