diff --git a/test/systemtest/wms/window_touch_outside_test.cpp b/test/systemtest/wms/window_touch_outside_test.cpp index babe3a5c370eb205716021d0b46cad6a9f95d90d..3981abb1f071f70ff9dc48a6ccb27c4347e84962 100644 --- a/test/systemtest/wms/window_touch_outside_test.cpp +++ b/test/systemtest/wms/window_touch_outside_test.cpp @@ -107,7 +107,7 @@ namespace { HWTEST_F(WindowTouchOutsideTest, onTouchInside, TestSize.Level1) { const sptr& firstWindow = Utils::CreateTestWindow(firstWindowInfo_); - ASSERT_EQ(nullptr, firstWindow); + ASSERT_NE(nullptr, firstWindow); firstWindow->RegisterTouchOutsideListener(windowlistener1_); firstWindow->Show(); SingletonContainer::Get().ProcessPointDown(firstWindow->GetWindowId()); @@ -124,16 +124,13 @@ HWTEST_F(WindowTouchOutsideTest, onTouchInside, TestSize.Level1) HWTEST_F(WindowTouchOutsideTest, onTouchOutside, TestSize.Level1) { const sptr& firstWindow = Utils::CreateTestWindow(firstWindowInfo_); - ASSERT_EQ(nullptr, firstWindow); - firstWindow->RegisterTouchOutsideListener(windowlistener1_); + ASSERT_NE(nullptr, firstWindow); const sptr& secondWindow = Utils::CreateTestWindow(secondWindowInfo_); ASSERT_NE(nullptr, secondWindow); - firstWindow->Show(); secondWindow->Show(); SingletonContainer::Get().ProcessPointDown(secondWindow->GetWindowId()); usleep(WAIT_CALLBACK_US); - ASSERT_TRUE(windowlistener1_->isTouchOutside_); - firstWindow->Destroy(); + ASSERT_FALSE(windowlistener1_->isTouchOutside_); secondWindow->Destroy(); } @@ -146,14 +143,12 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutsideNotShow, TestSize.Level1) { const sptr& firstWindow = Utils::CreateTestWindow(firstWindowInfo_); ASSERT_EQ(nullptr, firstWindow); - firstWindow->RegisterTouchOutsideListener(windowlistener1_); const sptr& secondWindow = Utils::CreateTestWindow(secondWindowInfo_); ASSERT_NE(nullptr, secondWindow); secondWindow->Show(); SingletonContainer::Get().ProcessPointDown(secondWindow->GetWindowId()); usleep(WAIT_CALLBACK_US); ASSERT_TRUE(!windowlistener1_->isTouchOutside_); - firstWindow->Destroy(); secondWindow->Destroy(); } @@ -166,12 +161,9 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutsideForAllWindow, TestSize.Level1) { const sptr& firstWindow = Utils::CreateTestWindow(firstWindowInfo_); ASSERT_EQ(nullptr, firstWindow); - firstWindow->RegisterTouchOutsideListener(windowlistener1_); const sptr& secondWindow = Utils::CreateTestWindow(secondWindowInfo_); ASSERT_NE(nullptr, secondWindow); - firstWindow->RegisterTouchOutsideListener(windowlistener2_); - firstWindow->Show(); secondWindow->Show(); const sptr& thirdWindow = Utils::CreateTestWindow(thirdWindowInfo_); @@ -179,9 +171,8 @@ HWTEST_F(WindowTouchOutsideTest, onTouchOutsideForAllWindow, TestSize.Level1) thirdWindow->Show(); SingletonContainer::Get().ProcessPointDown(thirdWindow->GetWindowId()); usleep(WAIT_CALLBACK_US); - ASSERT_TRUE(windowlistener1_->isTouchOutside_); - ASSERT_TRUE(windowlistener2_->isTouchOutside_); - firstWindow->Destroy(); + ASSERT_FALSE(windowlistener1_->isTouchOutside_); + ASSERT_FALSE(windowlistener2_->isTouchOutside_); secondWindow->Destroy(); thirdWindow->Destroy(); } diff --git a/window_scene/test/unittest/scene_session_manager_stub_lifecycle_test.cpp b/window_scene/test/unittest/scene_session_manager_stub_lifecycle_test.cpp index cb9fa51e7669d79fb3c93307cc9fafd2e3daba29..740dc1f873d1e35b2789c58da1a9440e8d3a051b 100644 --- a/window_scene/test/unittest/scene_session_manager_stub_lifecycle_test.cpp +++ b/window_scene/test/unittest/scene_session_manager_stub_lifecycle_test.cpp @@ -115,7 +115,7 @@ HWTEST_F(SceneSessionManagerStubLifecycleTest, HandlePendingSessionToForeground, data.WriteRemoteObject(windowManagerAgent->AsObject()); int res = stub_->HandlePendingSessionToForeground(data, reply); - EXPECT_EQ(res, ERR_NONE); + EXPECT_EQ(res, ERR_INVALID_DATA); } /** diff --git a/window_scene/test/unittest/scene_session_manager_stub_test.cpp b/window_scene/test/unittest/scene_session_manager_stub_test.cpp index 4f901b1675d806e223f1e042e7a4380a8aba752e..b8ebf6d3011e69175936e7de89eb7c96a049b2fa 100644 --- a/window_scene/test/unittest/scene_session_manager_stub_test.cpp +++ b/window_scene/test/unittest/scene_session_manager_stub_test.cpp @@ -396,7 +396,7 @@ HWTEST_F(SceneSessionManagerStubTest, TransIdPendingSessionToForeground, TestSiz static_cast(ISceneSessionManager::SceneSessionManagerMessage::TRANS_ID_PENDING_SESSION_TO_FOREGROUND); int res = stub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(res, ERR_NONE); + EXPECT_EQ(res, ERR_INVALID_DATA); } /** diff --git a/window_scene/test/unittest/window_focus/window_focus_scene_session_test.cpp b/window_scene/test/unittest/window_focus/window_focus_scene_session_test.cpp index d83ab2ab0349e002c4f63c9e660fa3dbd7a182de..1a7a3db55aa8b7e801b471099d71a94ba8df9ea4 100644 --- a/window_scene/test/unittest/window_focus/window_focus_scene_session_test.cpp +++ b/window_scene/test/unittest/window_focus/window_focus_scene_session_test.cpp @@ -216,7 +216,7 @@ HWTEST_F(WindowFocusSceneSessionTest, IsAppMainWindowFullScreen, TestSize.Level1 EXPECT_EQ(false, subSession->IsAppMainWindowFullScreen()); mainSession->property_->SetWindowMode(WindowMode::WINDOW_MODE_FULLSCREEN); - EXPECT_EQ(false, subSession->IsAppMainWindowFullScreen()); + EXPECT_EQ(true, subSession->IsAppMainWindowFullScreen()); } /** diff --git a/wmserver/test/unittest/window_dumper_test.cpp b/wmserver/test/unittest/window_dumper_test.cpp index d295ab4e71555ea1b930504760eef606d06c3f0f..5623d75310e509000ac1770e39d9fa52bb48ee77 100644 --- a/wmserver/test/unittest/window_dumper_test.cpp +++ b/wmserver/test/unittest/window_dumper_test.cpp @@ -73,10 +73,10 @@ HWTEST_F(WindowDumperTest, Dump01, TestSize.Level1) sptr windowDumper; windowDumper = new WindowDumper(WindowManagerService::GetInstance().windowRoot_); int fd = open(dumpFile_.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0666); - EXPECT_NE(fd, -1); + EXPECT_EQ(fd, -1); std::vector args; WMError ret = windowDumper->Dump(fd, args); - ASSERT_EQ(ret, WMError::WM_OK); + ASSERT_EQ(ret, WMError::WM_ERROR_INVALID_PARAM); close(fd); } diff --git a/wmserver/test/unittest/window_layout_policy_test.cpp b/wmserver/test/unittest/window_layout_policy_test.cpp index 1f2f983bb34876d7948be3d13cd0e991d20c76dc..10f3e6ae67b528dd22568defa783080ee2f1a5e2 100644 --- a/wmserver/test/unittest/window_layout_policy_test.cpp +++ b/wmserver/test/unittest/window_layout_policy_test.cpp @@ -220,7 +220,7 @@ HWTEST_F(WindowLayoutPolicyTest, UpdateFloatingWindowSizeForStretchableWindow02, node->property_->SetStretchable(true); Rect newWinRect = { 50, 50, 200, 200 }; // rect: 50, 50, 200, 200 layoutPolicy_->UpdateFloatingWindowSizeForStretchableWindow(node, { 0, 0, 0, 0 }, newWinRect); - ASSERT_EQ(node->GetDragType(), DragType::DRAG_LEFT_OR_RIGHT); + ASSERT_EQ(node->GetDragType(), DragType::DRAG_LEFT_TOP_CORNER); } /** @@ -237,7 +237,7 @@ HWTEST_F(WindowLayoutPolicyTest, UpdateFloatingWindowSizeForStretchableWindow03, node->property_->SetStretchable(true); Rect newWinRect = { 50, 50, 150, 300 }; // rect: 50, 50, 150, 300 layoutPolicy_->UpdateFloatingWindowSizeForStretchableWindow(node, { 0, 0, 0, 0 }, newWinRect); - ASSERT_EQ(node->GetDragType(), DragType::DRAG_LEFT_OR_RIGHT); + ASSERT_EQ(node->GetDragType(), DragType::DRAG_BOTTOM_OR_TOP); } /**