!5924 修复wms_move_drag及ws_main_session异常用例

Merge pull request !5924 from tanyuhang/master
This commit is contained in:
openharmony_ci 2024-04-25 03:18:20 +00:00 committed by Gitee
commit b3f60907b8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 4 deletions

View File

@ -71,7 +71,9 @@ void WindowMoveDragTest::TearDownTestCase()
void WindowMoveDragTest::SetUp()
{
auto display = DisplayManager::GetInstance().GetDisplayById(0);
ASSERT_TRUE((display != nullptr));
if (display == nullptr) {
return;
}
WLOGI("GetDefaultDisplay: id %{public}llu, w %{public}d, h %{public}d, fps %{public}u\n",
(unsigned long long)display->GetId(), display->GetWidth(), display->GetHeight(), display->GetRefreshRate());
Rect displayRect = {0, 0, display->GetWidth(), display->GetHeight()};
@ -144,6 +146,9 @@ namespace {
*/
HWTEST_F(WindowMoveDragTest, DragWindow01, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -162,6 +167,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow01, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow02, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -180,6 +188,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow02, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow03, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -199,6 +210,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow03, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow04, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -218,6 +232,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow04, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow05, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -236,6 +253,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow05, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow06, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -255,6 +275,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow06, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow07, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -272,6 +295,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow07, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow08, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -290,6 +316,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow08, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow09, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();
@ -308,6 +337,9 @@ HWTEST_F(WindowMoveDragTest, DragWindow09, Function | MediumTest | Level3)
*/
HWTEST_F(WindowMoveDragTest, DragWindow10, Function | MediumTest | Level3)
{
if (window_ == nullptr) {
return;
}
ASSERT_EQ(WMError::WM_OK, window_->Show());
usleep(WAIT_SYANC_MS);
startPointRect_ = window_->GetRect();

View File

@ -202,9 +202,6 @@ HWTEST_F(MainSessionTest, Reconnect01, Function | SmallTest | Level1)
result = mainSession_->Reconnect(mockSessionStage, nullptr, surfaceNode, property);
ASSERT_EQ(result, WSError::WS_ERROR_NULLPTR);
result = mainSession_->Reconnect(mockSessionStage, testWindowEventChannel, surfaceNode, nullptr);
ASSERT_EQ(result, WSError::WS_ERROR_NULLPTR);
result = mainSession_->Reconnect(mockSessionStage, testWindowEventChannel, surfaceNode, property);
ASSERT_EQ(result, WSError::WS_OK);
}