提交 123c5739 编写于 作者: P pssea

Description: add view bounds test case

issueNo: https://gitee.com/openharmony/graphic_ui/issues/I3X08Y
Feature or Bugfix: Feature
Binary Source:No
Signed-off-by: Nlizhiqi <lizhiqi1@huawei.com>

Change-Id: I75d2c939174bc3dd333f3f562f72d1f6757f5f3b
上级 15a6a090
......@@ -101,6 +101,44 @@ HWTEST_F(ViewBoundsTest, ViewBoundsSetState001, TestSize.Level0)
EXPECT_EQ(state, false);
}
/**
* @tc.name: ViewBoundsSetState002
* @tc.desc: Verity if view bounds state equal when calling multi times
* @tc.type: FUNC
* @tc.require: AR000FQNFN
*/
HWTEST_F(ViewBoundsTest, ViewBoundsSetState002, TestSize.Level1)
{
uint16_t count = 10000; // 10000: call times
for (uint16_t i = 0; i < count; i++) {
UIViewBounds::GetInstance()->SetShowState(true);
}
bool state = UIViewBounds::GetInstance()->GetShowState();
EXPECT_EQ(state, true);
for (uint16_t i = 0; i < count; i++) {
UIViewBounds::GetInstance()->SetShowState(false);
}
state = UIViewBounds::GetInstance()->GetShowState();
EXPECT_EQ(state, false);
for (uint16_t i = 0; i < count; i++) {
UIViewBounds::GetInstance()->SetShowState(true);
UIViewBounds::GetInstance()->SetShowState(false);
UIViewBounds::GetInstance()->SetShowState(true);
}
state = UIViewBounds::GetInstance()->GetShowState();
EXPECT_EQ(state, true);
for (uint16_t i = 0; i < count; i++) {
UIViewBounds::GetInstance()->SetShowState(false);
UIViewBounds::GetInstance()->SetShowState(true);
UIViewBounds::GetInstance()->SetShowState(false);
}
state = UIViewBounds::GetInstance()->GetShowState();
EXPECT_EQ(state, false);
}
/**
* @tc.name: ViewBoundsOnPostDraw001
* @tc.desc: Test if trigger redraw when change view bounds state with sigle window
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册