!48932 【UT】web_pattern用例修改

Merge pull request !48932 from wangweiyuan/master
This commit is contained in:
openharmony_ci 2024-11-20 09:46:41 +00:00 committed by Gitee
commit 5375e7d49d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -685,19 +685,42 @@ HWTEST_F(WebPatternTestNgSupplement, SetAccessibilityState001, TestSize.Level1)
webPattern->OnModifyDone();
ASSERT_NE(webPattern->delegate_, nullptr);
webPattern->accessibilityState_ = false;
webPattern->SetAccessibilityState(false);
EXPECT_FALSE(webPattern->accessibilityState_);
webPattern->accessibilityState_ = true;
webPattern->SetAccessibilityState(true);
EXPECT_TRUE(webPattern->accessibilityState_);
AceApplicationInfo::GetInstance().SetAccessibilityEnabled(true);
webPattern->SetAccessibilityState(false);
EXPECT_TRUE(webPattern->accessibilityState_);
AceApplicationInfo::GetInstance().SetAccessibilityEnabled(false);
webPattern->inspectorAccessibilityEnable_ = false;
webPattern->textBlurAccessibilityEnable_ = false;
webPattern->SetAccessibilityState(false);
EXPECT_FALSE(webPattern->accessibilityState_);
webPattern->inspectorAccessibilityEnable_ = false;
webPattern->textBlurAccessibilityEnable_ = false;
webPattern->SetAccessibilityState(false);
EXPECT_FALSE(webPattern->accessibilityState_);
webPattern->inspectorAccessibilityEnable_ = false;
webPattern->textBlurAccessibilityEnable_ = true;
webPattern->SetAccessibilityState(false);
EXPECT_FALSE(webPattern->accessibilityState_);
webPattern->inspectorAccessibilityEnable_ = true;
webPattern->textBlurAccessibilityEnable_ = false;
webPattern->SetAccessibilityState(false);
EXPECT_FALSE(webPattern->accessibilityState_);
webPattern->inspectorAccessibilityEnable_ = true;
webPattern->textBlurAccessibilityEnable_ = true;
webPattern->SetAccessibilityState(false);
EXPECT_FALSE(webPattern->accessibilityState_);
webPattern->accessibilityState_ = true;
webPattern->inspectorAccessibilityEnable_ = false;
webPattern->textBlurAccessibilityEnable_ = true;
webPattern->SetAccessibilityState(false);
EXPECT_TRUE(webPattern->accessibilityState_);
webPattern->inspectorAccessibilityEnable_ = true;
webPattern->textBlurAccessibilityEnable_ = false;
webPattern->SetAccessibilityState(false);
EXPECT_TRUE(webPattern->accessibilityState_);
webPattern->inspectorAccessibilityEnable_ = true;
webPattern->textBlurAccessibilityEnable_ = true;
webPattern->SetAccessibilityState(false);
EXPECT_TRUE(webPattern->accessibilityState_);
#endif
}