修复测试用例failed

Signed-off-by: zwx1339610 <zhangyu841@h-partners.com>
This commit is contained in:
zwx1339610 2024-05-13 18:10:06 +08:00
parent fcaa0c9868
commit a05ccd5f27
3 changed files with 12 additions and 9 deletions

View File

@ -75,7 +75,8 @@ sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbilityWrapper(int32_t
sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId)
{
(void)systemAbilityId;
return nullptr;
sptr<IRemoteObject> remote = new OHOS::Accessibility::MockAccessibleAbilityManagerServiceStub();
return remote;
}
sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId, const std::string& deviceId)

View File

@ -599,8 +599,8 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_SetEnab
accountData->Init();
bool state = true;
bool test = accountData->GetConfig()->SetEnabled(state);
EXPECT_TRUE(test);
RetError test = accountData->GetConfig()->SetEnabled(state);
EXPECT_EQ(test, RET_OK);
GTEST_LOG_(INFO) << "AccessibilityAccountData_Unittest_SetEnabled end";
}
@ -923,8 +923,8 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_SetTouc
accountData->Init();
bool state = true;
bool test = accountData->GetConfig()->SetTouchGuideState(state);
EXPECT_TRUE(test);
RetError test = accountData->GetConfig()->SetTouchGuideState(state);
EXPECT_EQ(test, RET_OK);
bool result = accountData->GetConfig()->GetTouchGuideState();
EXPECT_TRUE(result);
@ -940,8 +940,8 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_SetGest
accountData->Init();
bool state = false;
bool test = accountData->GetConfig()->SetGestureState(state);
EXPECT_TRUE(test);
RetError test = accountData->GetConfig()->SetGestureState(state);
EXPECT_EQ(test, RET_OK);
bool result = accountData->GetConfig()->GetGestureState();
EXPECT_FALSE(result);
@ -957,8 +957,8 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_SetKeyE
accountData->Init();
bool state = true;
bool test = accountData->GetConfig()->SetKeyEventObserverState(state);
EXPECT_TRUE(test);
RetError test = accountData->GetConfig()->SetKeyEventObserverState(state);
EXPECT_EQ(test, RET_OK);
bool result = accountData->GetConfig()->GetKeyEventObserverState();
EXPECT_TRUE(result);

View File

@ -915,6 +915,8 @@ HWTEST_F(AccessibilityWindowManagerTest, AccessibilityWindowManager_Unittest_OnW
sptr<Rosen::AccessibilityWindowInfo> rosen_winInfo_second = GetRosenWindowInfo(Rosen::WindowType::APP_WINDOW_BASE);
rosen_winInfo_second->bundleName_ = "rosen_winInfo_second";
rosen_winInfo_second->touchHotAreas_ = {Rosen::Rect{0, 0, 3, 3}, Rosen::Rect{3, 3, 6, 6}};
rosen_winInfo_second->wid_ = 2;
rosen_winInfo_second->innerWid_ = 2;
std::vector<sptr<Rosen::AccessibilityWindowInfo>> infos;
infos.emplace_back(rosen_winInfo_first);
infos.emplace_back(rosen_winInfo_second);