summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatt Delco <delco@google.com>2019-02-13 12:31:09 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-16 05:23:59 -0700
commitfa656b63a573c50f62ebdce46f70ee2fa2acbd23 (patch)
tree36808a7fdc6a2ad5250b6e7c99e8e62066f8136e /tests
parent26f9bf2e1b2ebc0b9fb76281f22db6ac99db5d7e (diff)
downloadvboot-fa656b63a573c50f62ebdce46f70ee2fa2acbd23.tar.gz
vboot: add power button query functionality
The primary purpose of this change is to add a flag to VbExGetSwitches() so the current user physical presence (via the status of the power button) can be queried. The flags have also been renamed from the historical _INIT_ use to _SWITCH_ to reflect the current/actual API they're used with. BUG=b:124358784 BRANCH=none TEST=Locally built and flashed. Confirmed that the power button status can be queried when the power button is disabled. CQ-DEPEND=CL:1470273 Change-Id: I579ebe657ae35fb866eb30b466e8e8c16f54e584 Signed-off-by: Matt Delco <delco@google.com> Reviewed-on: https://chromium-review.googlesource.com/1471190 Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/vboot_api_kernel2_tests.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c
index c878ce37..006e8812 100644
--- a/tests/vboot_api_kernel2_tests.c
+++ b/tests/vboot_api_kernel2_tests.c
@@ -268,7 +268,7 @@ static void VbUserConfirmsTest(void)
0, "Untrusted keyboard");
ResetMocks();
- mock_switches[0] = VB_INIT_FLAG_REC_BUTTON_PRESSED;
+ mock_switches[0] = VB_SWITCH_FLAG_REC_BUTTON_PRESSED;
TEST_EQ(VbUserConfirms(&ctx,
VB_CONFIRM_SPACE_MEANS_NO |
VB_CONFIRM_MUST_TRUST_KEYBOARD),
@@ -279,7 +279,7 @@ static void VbUserConfirmsTest(void)
mock_keypress[1] = 'y';
mock_keypress[2] = 'z';
mock_keypress[3] = ' ';
- mock_switches[0] = VB_INIT_FLAG_REC_BUTTON_PRESSED;
+ mock_switches[0] = VB_SWITCH_FLAG_REC_BUTTON_PRESSED;
mock_switches_are_stuck = 1;
TEST_EQ(VbUserConfirms(&ctx,
VB_CONFIRM_SPACE_MEANS_NO |
@@ -998,7 +998,7 @@ static void VbBootRecTest(void)
trust_ec = 1;
shutdown_request_calls_left = 100;
mock_keypress[0] = VB_KEY_CTRL('D');
- mock_switches[0] = VB_INIT_FLAG_REC_BUTTON_PRESSED;
+ mock_switches[0] = VB_SWITCH_FLAG_REC_BUTTON_PRESSED;
TEST_EQ(VbBootRecovery(&ctx),
VBERROR_SHUTDOWN_REQUESTED,
"Ctrl+D ignored if phys rec button is still pressed");