diff --git a/services/aams/test/unittest/accessible_ability_channel_test.cpp b/services/aams/test/unittest/accessible_ability_channel_test.cpp index c35fb79d..350a946c 100644 --- a/services/aams/test/unittest/accessible_ability_channel_test.cpp +++ b/services/aams/test/unittest/accessible_ability_channel_test.cpp @@ -467,5 +467,25 @@ HWTEST_F(AccessibleAbilityChannelUnitTest, EXPECT_EQ(channel->SetTargetBundleName(targetBundleNames), RET_ERR_NO_CONNECTION); GTEST_LOG_(INFO) << "AccessibleAbilityChannel_Unittest_SetTargetBundleName_002 end"; } + +/** + * @tc.number: AccessibleAbilityChannel_Unittest_GetCursorPosition_001 + * @tc.name: GetCursorPosition + * @tc.desc: Test function GetCursorPosition + */ +HWTEST_F(AccessibleAbilityChannelUnitTest, + AccessibleAbilityChannel_Unittest_GetCursorPosition_001, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "AccessibleAbilityChannel_Unittest_GetCursorPosition_001 start"; + sptr accountData = + Singleton::GetInstance().GetCurrentAccountData(); + ASSERT_TRUE(accountData); + std::string abilityName = "testSetTargetBundleName"; + EXPECT_FALSE(accountData->GetAccessibleAbilityConnection(abilityName)); + sptr channel = new AccessibleAbilityChannel(accountData->GetAccountId(), abilityName); + + EXPECT_EQ(channel->GetCursorPosition(WINDOW_ID, ELEMENT_ID, 0, nullptr), RET_ERR_NO_CONNECTION); + GTEST_LOG_(INFO) << "AccessibleAbilityChannel_Unittest_GetCursorPosition_001 end"; +} } // namespace Accessibility } // namespace OHOS \ No newline at end of file