修改测试用例接口判断

Signed-off-by: zhanghuiyu <zhanghuiyu9@huawei.com>
This commit is contained in:
zhanghuiyu 2023-06-05 13:03:46 +00:00 committed by Gitee
parent 21e7a486d8
commit f947827c74
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -106,8 +106,8 @@ namespace {
{
while (state.KeepRunning()) {
AccessibilityElementInfo elementInfo;
bool result = AccessibilityUITestAbility::GetInstance()->GetRoot(elementInfo);
if (!result) {
int32_t result = AccessibilityUITestAbility::GetInstance()->GetRoot(elementInfo);
if (result != 0) {
state.SkipWithError("GetRoot failed. Maybe there is no command to set ace");
}
}
@ -124,7 +124,10 @@ namespace {
{
while (state.KeepRunning()) {
std::vector<AccessibilityWindowInfo> windows;
AccessibilityUITestAbility::GetInstance()->GetWindows(windows);
int32_t result = AccessibilityUITestAbility::GetInstance()->GetWindows(windows);
if (result != 0) {
state.SkipWithError("GetWindows failed.");
}
}
}
@ -160,7 +163,10 @@ namespace {
gesturePath->SetDurationTime(durationTime);
AccessibilityGesturePosition position = {200.0f, 200.0f};
gesturePath->AddPosition(position);
AccessibilityUITestAbility::GetInstance()->InjectGesture(gesturePath);
int32_t result = AccessibilityUITestAbility::GetInstance()->InjectGesture(gesturePath);
if (result != 0) {
state.SkipWithError("InjectGesture failed.");
}
}
}
}