!1201 新增接口覆盖

Merge pull request !1201 from yangyuchun/master
This commit is contained in:
openharmony_ci 2024-07-10 01:52:34 +00:00 committed by Gitee
commit 6e520cd1ae
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 26 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include <gtest/gtest.h>
#include <memory>
#include "accessibility_common_helper.h"
#include "accessibility_system_ability_client.h"
#include "accessibility_system_ability_client_impl.h"
#include "mock_accessibility_element_operator.h"

View File

@ -1335,5 +1335,30 @@ HWTEST_F(AccessibilityElementInfoTest, SetBelongTreeId_001, TestSize.Level1)
GTEST_LOG_(INFO) << "SetBelongTreeId_001 end";
}
/**
* @tc.number: SetAccessibilityGroup_001
* @tc.name: SetAccessibilityGroup
* @tc.desc: Test function SetAccessibilityGroup, GetAccessibilityGroup
*/
HWTEST_F(AccessibilityElementInfoTest, SetAccessibilityGroup_001, TestSize.Level1)
{
GTEST_LOG_(INFO) << "SetAccessibilityGroup_001 start";
elementInfo_->SetAccessibilityGroup(false);
EXPECT_FALSE(elementInfo_->GetAccessibilityGroup());
GTEST_LOG_(INFO) << "SetAccessibilityGroup_001 end";
}
/**
* @tc.number: SetAccessibilityLevel_001
* @tc.name: SetAccessibilityLevel
* @tc.desc: Test function SetAccessibilityLevel, GetAccessibilityLevel
*/
HWTEST_F(AccessibilityElementInfoTest, SetAccessibilityLevel_001, TestSize.Level1)
{
GTEST_LOG_(INFO) << "SetAccessibilityLevel_001 start";
elementInfo_->SetAccessibilityLevel("test");
EXPECT_STREQ(elementInfo_->GetAccessibilityLevel().c_str(), "test");
GTEST_LOG_(INFO) << "SetAccessibilityLevel_001 end";
}
} // namespace Accessibility
} // namespace OHOS