Merge cherrypicks of ['android-review.googlesource.com/3192000'] into 24Q3-release.

Change-Id: I5086af46494b19c34050939aff2b503f507f6442
This commit is contained in:
Android Build Coastguard Worker 2024-08-02 22:32:02 +00:00
commit 488942f82b

View file

@ -16,6 +16,10 @@
#define LOG_TAG "nfc_behavior_changes_test"
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/nfc/BnNfc.h>
#include <aidl/android/hardware/nfc/INfc.h>
#include <android-base/logging.h>
#include <android-base/stringprintf.h>
#include <android/binder_process.h>
@ -30,6 +34,9 @@
#include "nfa_api.h"
#include "nfa_ee_api.h"
using aidl::android::hardware::nfc::INfc;
using android::getAidlHalInstanceNames;
using android::PrintInstanceNameToString;
using android::base::StringPrintf;
static SyncEvent sNfaEnableEvent; // event for NFA_Enable()
@ -162,7 +169,7 @@ tNFA_STATUS static nfaObserveModeEnable(bool enable) {
return status;
}
class NfcBehaviorChanges : public testing::Test {
class NfcBehaviorChanges : public testing::TestWithParam<std::string> {
protected:
void SetUp() override {
tNFA_STATUS status = NFA_STATUS_OK;
@ -202,7 +209,7 @@ class NfcBehaviorChanges : public testing::Test {
*
* @VsrTest = GMS-VSR-3.2.8-001
*/
TEST_F(NfcBehaviorChanges, ObserveModeEnableDisable) {
TEST_P(NfcBehaviorChanges, ObserveModeEnableDisable) {
tNFA_STATUS status = nfaObserveModeEnable(true);
ASSERT_EQ(status, NFA_STATUS_OK);
@ -210,6 +217,11 @@ TEST_F(NfcBehaviorChanges, ObserveModeEnableDisable) {
ASSERT_EQ(status, NFA_STATUS_OK);
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NfcBehaviorChanges);
INSTANTIATE_TEST_SUITE_P(Nfc, NfcBehaviorChanges,
testing::ValuesIn(::android::getAidlHalInstanceNames(INfc::descriptor)),
::android::PrintInstanceNameToString);
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
ABinderProcess_startThreadPool();