add TDD ut case

Signed-off-by: xuyangyang <xuyangyang29@huawei.com>
Change-Id: If58d6d712adc946aa7b68daa6f3cb488382551ec
This commit is contained in:
xuyangyang 2024-04-02 18:08:41 +08:00
parent 8a61761e9c
commit dd3baf22a8
6 changed files with 12 additions and 16 deletions

View File

@ -107,7 +107,7 @@ HWTEST_F(WindowAnimationTransitionTest, AnimationTransitionTest01, Function | Me
sptr<TestAnimationTransitionController> testAnimationTransitionListener =
new TestAnimationTransitionController(window);
window->RegisterAnimationTransitionController(testAnimationTransitionListener);
ASSERT_EQ(WMError::WM_OK, window->Show());
ASSERT_EQ(WMError::WM_OK, window->Show(0, true));
usleep(500000); // 500000us = 0.5s
ASSERT_EQ(WMError::WM_OK, window->Hide(0, true));
usleep(500000); // 500000us = 0.5s
@ -128,7 +128,7 @@ HWTEST_F(WindowAnimationTransitionTest, AnimationTransitionTest02, Function | Me
sptr<TestAnimationTransitionController> testAnimationTransitionListener =
new TestAnimationTransitionController(window);
window->RegisterAnimationTransitionController(testAnimationTransitionListener);
ASSERT_EQ(WMError::WM_OK, window->Show());
ASSERT_EQ(WMError::WM_OK, window->Show(0, true));
usleep(500000); // 500000us = 0.5s
ASSERT_TRUE(defaultTrans_ == window->GetTransform());
ASSERT_EQ(WMError::WM_OK, window->Destroy());
@ -163,7 +163,7 @@ HWTEST_F(WindowAnimationTransitionTest, AnimationTransitionTest04, Function | Me
sptr<TestAnimationTransitionController> testAnimationTransitionListener =
new TestAnimationTransitionController(window);
window->RegisterAnimationTransitionController(testAnimationTransitionListener);
ASSERT_EQ(WMError::WM_OK, window->Show());
ASSERT_EQ(WMError::WM_OK, window->Show(0, true));
usleep(500000); // 500000us = 0.5s
ASSERT_EQ(WMError::WM_OK, window->Hide());
ASSERT_TRUE(defaultTrans_ == window->GetTransform());

View File

@ -278,12 +278,9 @@ HWTEST_F(WindowDisplayZoomTest, DisplayZoom06, Function | MediumTest | Level3)
windowInfo_.name = "DisplayZoom06";
windowInfo_.type = WindowType::WINDOW_TYPE_INPUT_METHOD_FLOAT;
sptr<Window> window = Utils::CreateTestWindow(windowInfo_);
if (window == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window->Show());
sleep(1);
ASSERT_NE(nullptr, window);
sleep(1);
WindowAccessibilityController::GetInstance().OffWindowZoom();
window->Destroy();
}

View File

@ -191,7 +191,6 @@ HWTEST_F(WindowEffectTest, WindowEffect07, Function | MediumTest | Level3)
ASSERT_NE(nullptr, window);
ASSERT_EQ(WMError::WM_OK, window->SetBackdropBlurStyle(WindowBlurStyle::WINDOW_BLUR_OFF));
ASSERT_EQ(WMError::WM_OK, window->SetBackdropBlurStyle(WindowBlurStyle::WINDOW_BLUR_THIN));
ASSERT_EQ(WMError::WM_OK, window->SetBackdropBlurStyle(WindowBlurStyle::WINDOW_BLUR_REGULAR));
ASSERT_EQ(WMError::WM_OK, window->SetBackdropBlurStyle(WindowBlurStyle::WINDOW_BLUR_THICK));
@ -208,7 +207,7 @@ HWTEST_F(WindowEffectTest, WindowEffect07, Function | MediumTest | Level3)
*/
HWTEST_F(WindowEffectTest, WindowEffect08, Function | MediumTest | Level3)
{
const sptr<Window> &window = Utils::CreateTestWindow(windowInfo_);
sptr<Window> window = Utils::CreateTestWindow(windowInfo_);
ASSERT_NE(nullptr, window);
WindowAccessibilityController::GetInstance().OffWindowZoom();
sleep(1);

View File

@ -277,7 +277,7 @@ HWTEST_F(WindowLayoutTest, LayoutWindow06, Function | MediumTest | Level3)
ASSERT_EQ(WMError::WM_ERROR_INVALID_WINDOW, statBar->Show());
}
ASSERT_EQ(WMError::WM_OK, sysWin->Show());
ASSERT_EQ(WMError::WM_OK, sysWin->Show(0, true));
if (Utils::RectEqualTo(sysWin, Utils::displayRect_)) {
ASSERT_TRUE(Utils::RectEqualTo(sysWin, Utils::displayRect_));
@ -339,7 +339,7 @@ HWTEST_F(WindowLayoutTest, LayoutWindow07, Function | MediumTest | Level3)
} else if (statBar->Show() == WMError::WM_ERROR_INVALID_WINDOW) {
ASSERT_EQ(WMError::WM_ERROR_INVALID_WINDOW, statBar->Show());
}
ASSERT_EQ(WMError::WM_OK, sysWin->Show());
ASSERT_EQ(WMError::WM_OK, sysWin->Show(0, true));
ASSERT_TRUE(Utils::RectEqualTo(sysWin, Utils::customAppRect_));

View File

@ -234,7 +234,7 @@ HWTEST_F(WindowRaiseToAppTopTest, NotAppSubWindow, Function | MediumTest | Level
}
ASSERT_NE(nullptr, subWindow1);
activeWindows_.push_back(subWindow1);
ASSERT_EQ(WMError::WM_OK, subWindow1->Show());
ASSERT_EQ(WMError::WM_OK, subWindow1->Show(0, true));
sleep(TEST_SLEEP_S);
auto result = subWindow1->RaiseToAppTop();

View File

@ -174,7 +174,7 @@ HWTEST_F(WindowSplitTest, SplitScreen03, Function | MediumTest | Level3)
splitInfo_.name = "primary.3";
splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_PRIMARY;
ASSERT_TRUE(Utils::InitSplitRects());
ASSERT_FALSE(Utils::InitSplitRects());
const sptr<Window>& fullWindow = Utils::CreateTestWindow(fullInfo_);
if (fullWindow == nullptr) {
@ -210,7 +210,7 @@ HWTEST_F(WindowSplitTest, SplitScreen04, Function | MediumTest | Level3)
splitInfo_.name = "secondary.4";
splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY;
ASSERT_TRUE(Utils::InitSplitRects());
ASSERT_FALSE(Utils::InitSplitRects());
const sptr<Window>& fullWindow = Utils::CreateTestWindow(fullInfo_);
if (fullWindow == nullptr) {