vboot/ui: Synchronize mock inputs for vb2_ui_tests

We have two different mock inputs currently, and soon to be three.

Since the input-solving order should not be strictly defined, it is
difficult to write complicated scenarios under current approach. We
cannot make sure if the ui_loop implementation exits earlier and
ignores certain mock inputs.

This CL synchronizes mock inputs with an iteration counter. We can
write detailed scenarios by assigning the inputs iter-by-iter.

BUG=b:146399181, b:156448738
TEST=make clean && make runtests
TEST=make clean && DETACHABLE=1; make runtests
TEST=make clean && PHYSICAL_PRESENCE_KEYBOARD=1; make runtests
BRANCH=none

Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Change-Id: Ia839a6614eb0453b9f64075298a89a2db59d4070
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2217532
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
1 file changed