diff options
author | Joel Kitching <kitching@google.com> | 2020-06-09 12:19:50 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-17 05:20:58 +0000 |
commit | 720aef7804159721a6015a309335a32ce9d702a3 (patch) | |
tree | 3fe7fa234d148dfabb6e8206d57bd9ab02a81300 | |
parent | 110d598118702b6da049c3b609d216130b1baa51 (diff) | |
download | vboot-720aef7804159721a6015a309335a32ce9d702a3.tar.gz |
vboot/ui: use trusted keypress in cancel TO_DEV test
In order to ensure that the TO_DEV action function does not
trigger TO_DEV confirmation for the PHYSICAL_PRESENCE_KEYBOARD=1
case, use trusted DOWN and ENTER keys to navigate and press the
"Cancel" button. If this is erroneously picked up by the TO_DEV
action function, then a transition to developer mode will occur.
This hole in test coverage was discovered by CL:2234678.
BUG=b:146399181
TEST=PHYSICAL_PRESENCE_KEYBOARD=0 make runtests
TEST=PHYSICAL_PRESENCE_KEYBOARD=1 make runtests
BRANCH=none
Signed-off-by: Joel Kitching <kitching@google.com>
Change-Id: Id8db074e4e9398a2f7fbfe348059c2c195bc8d90
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2237088
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
-rw-r--r-- | tests/vb2_ui_tests.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/vb2_ui_tests.c b/tests/vb2_ui_tests.c index ba2e29a2..6c507b84 100644 --- a/tests/vb2_ui_tests.c +++ b/tests/vb2_ui_tests.c @@ -578,8 +578,8 @@ static void manual_recovery_tests(void) reset_common_data(FOR_MANUAL_RECOVERY); add_mock_key(VB_KEY_CTRL('D'), 1); if (PHYSICAL_PRESENCE_KEYBOARD) - add_mock_keypress(VB_KEY_DOWN); - add_mock_keypress(VB_KEY_ENTER); + add_mock_key(VB_KEY_DOWN, 1); + add_mock_key(VB_KEY_ENTER, 1); TEST_EQ(vb2_manual_recovery_menu(ctx), VB2_REQUEST_SHUTDOWN, "cancel"); TEST_EQ(mock_enable_dev_mode, 0, " dev mode not enabled"); |