mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-19 17:43:35 -04:00
@@ -62,6 +62,8 @@ ohos_unittest("distributed_input_inner_test") {
|
||||
"${ipc_path}/src/prepare_d_input_call_back_stub.cpp",
|
||||
"${ipc_path}/src/register_d_input_call_back_proxy.cpp",
|
||||
"${ipc_path}/src/register_d_input_call_back_stub.cpp",
|
||||
"${ipc_path}/src/register_session_state_callback_proxy.cpp",
|
||||
"${ipc_path}/src/register_session_state_callback_stub.cpp",
|
||||
"${ipc_path}/src/sharing_dhid_listener_proxy.cpp",
|
||||
"${ipc_path}/src/sharing_dhid_listener_stub.cpp",
|
||||
"${ipc_path}/src/simulation_event_listener_proxy.cpp",
|
||||
|
||||
@@ -113,6 +113,13 @@ int32_t DistributedInputInnerTest::TestSimulationEventListenerStub::OnSimulation
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
|
||||
void DistributedInputInnerTest::TestRegisterSessionStateCb::OnResult(const std::string &devId, const uint32_t status)
|
||||
{
|
||||
(void)devId;
|
||||
(void)status;
|
||||
return;
|
||||
}
|
||||
|
||||
int DistributedInputInnerTest::CheckSourceProxy() const
|
||||
{
|
||||
OHOS::sptr<OHOS::ISystemAbilityManager> systemAbilityManager =
|
||||
@@ -486,6 +493,19 @@ HWTEST_F(DistributedInputInnerTest, UnregisterSimulationEventListener02, testing
|
||||
int32_t ret = DistributedInputKit::UnregisterSimulationEventListener(listener);
|
||||
EXPECT_EQ(DH_SUCCESS, ret);
|
||||
}
|
||||
|
||||
HWTEST_F(DistributedInputInnerTest, RegisterSessionStateCb01, testing::ext::TestSize.Level0)
|
||||
{
|
||||
sptr<TestRegisterSessionStateCb> listener(new TestRegisterSessionStateCb());
|
||||
int32_t ret = DistributedInputKit::RegisterSessionStateCb(listener);
|
||||
EXPECT_EQ(DH_SUCCESS, ret);
|
||||
}
|
||||
|
||||
HWTEST_F(DistributedInputInnerTest, UnregisterSessionStateCb01, testing::ext::TestSize.Level0)
|
||||
{
|
||||
int32_t ret = DistributedInputKit::UnregisterSessionStateCb();
|
||||
EXPECT_EQ(DH_SUCCESS, ret);
|
||||
}
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
} // namespace OHOS
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "stop_d_input_call_back_stub.h"
|
||||
#include "simulation_event_listener_stub.h"
|
||||
#include "unprepare_d_input_call_back_stub.h"
|
||||
#include "register_session_state_callback_stub.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace DistributedHardware {
|
||||
@@ -109,6 +110,14 @@ public:
|
||||
virtual ~TestSimulationEventListenerStub() = default;
|
||||
int32_t OnSimulationEvent(uint32_t type, uint32_t code, int32_t value);
|
||||
};
|
||||
|
||||
class TestRegisterSessionStateCb : public
|
||||
OHOS::DistributedHardware::DistributedInput::RegisterSessionStateCallbackStub {
|
||||
public:
|
||||
TestRegisterSessionStateCb() = default;
|
||||
virtual ~TestRegisterSessionStateCb() = default;
|
||||
void OnResult(const std::string &devId, const uint32_t status);
|
||||
};
|
||||
};
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
|
||||
@@ -227,6 +227,17 @@ int32_t DistributedInputClient::UnregisterSimulationEventListener(sptr<ISimulati
|
||||
{
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t DistributedInputClient::RegisterSessionStateCb(sptr<ISessionStateCallback> callback)
|
||||
{
|
||||
(void)callback;
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t DistributedInputClient::UnregisterSessionStateCb()
|
||||
{
|
||||
return DH_SUCCESS;
|
||||
}
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
} // namespace OHOS
|
||||
|
||||
Reference in New Issue
Block a user