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>
diff --git a/tests/vb2_ui_tests.c b/tests/vb2_ui_tests.c
index ba2e29a..6c507b8 100644
--- a/tests/vb2_ui_tests.c
+++ b/tests/vb2_ui_tests.c
@@ -578,8 +578,8 @@
 	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");