Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e52e8804 authored by Ningyuan Wang's avatar Ningyuan Wang
Browse files

Add more VTS tests for ISupplicantP2pIface

This covers the following APIs by adding tests to
ISupplicantP2pIface:
ISupplicantP2pIface::SetGroupIdle(),
ISupplicantP2pIface::SetPowerSave()

Bug: 33457575
Test: VTS tests pass
Change-Id: I8291735e74cf88c0e1ee4b5297b39aa37c33d17c
parent 4ebd10a2
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

#include <android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.h>

#include "supplicant_hidl_call_util.h"
#include "supplicant_hidl_test_utils.h"

using ::android::sp;
@@ -42,6 +43,7 @@ constexpr char kTestConnectPin[] = "34556665";
constexpr char kTestGroupIfName[] = "TestGroup";
constexpr uint32_t kTestConnectGoIntent = 6;
constexpr uint32_t kTestFindTimeout = 5;
constexpr uint32_t kTestSetGroupIdleTimeout = 6;
constexpr SupplicantNetworkId kTestNetworkId = 5;
constexpr uint32_t kTestChannel = 1;
constexpr uint32_t kTestOperatingClass = 81;
@@ -411,3 +413,28 @@ TEST_F(SupplicantP2pIfaceHidlTest, SetMiracastMode) {
                                              status.code);
                                });
}

/*
 * SetGroupIdle
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetGroupIdle) {
    // This is not going to work with fake values.
    EXPECT_NE(SupplicantStatusCode::SUCCESS,
              HIDL_INVOKE(p2p_iface_, setGroupIdle, kTestGroupIfName,
                          kTestSetGroupIdleTimeout)
                  .code);
}

/*
 * SetPowerSave
 */
TEST_F(SupplicantP2pIfaceHidlTest, SetPowerSave) {
    // This is not going to work with fake values.
    EXPECT_NE(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setPowerSave, kTestGroupIfName, true).code);
    // This is not going to work with fake values.
    EXPECT_NE(
        SupplicantStatusCode::SUCCESS,
        HIDL_INVOKE(p2p_iface_, setPowerSave, kTestGroupIfName, false).code);
}