Improve OpenAfterOpen VTS test am: 056aa140ca

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3040299

Change-Id: I1ba8e032c62f3e5b21844f776ea0fc918d2f2529
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Bruno Carneiro 2024-04-12 21:40:08 +00:00 committed by Automerger Merge Worker
commit bdf398486d

View file

@ -562,7 +562,18 @@ TEST_P(NfcHidlTest, CloseAfterClose) {
*/
TEST_P(NfcHidlTest, OpenAfterOpen) {
EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
// Wait for OPEN_CPLT event
auto res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
EXPECT_TRUE(res.no_timeout);
EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
// Wait for OPEN_CPLT event
res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
EXPECT_TRUE(res.no_timeout);
EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NfcHidlTest);