diff --git a/window_scene/test/unittest/scene_session_lifecycle_test.cpp b/window_scene/test/unittest/scene_session_lifecycle_test.cpp index d4268e22410cc45a936e2b18690384fa46ab5eec..069b2085f75699b1495c716f2e329f370cc1ce6f 100644 --- a/window_scene/test/unittest/scene_session_lifecycle_test.cpp +++ b/window_scene/test/unittest/scene_session_lifecycle_test.cpp @@ -170,9 +170,6 @@ HWTEST_F(SceneSessionLifecycleTest, Foreground04, Function | SmallTest | Level2) sptr property = nullptr; EXPECT_EQ(WSError::WS_OK, session->Foreground(property, false)); - session->property_ = nullptr; - EXPECT_EQ(WSError::WS_OK, session->Foreground(property, false)); - info.windowType_ = static_cast(WindowType::ABOVE_APP_SYSTEM_WINDOW_BASE); sptr session1 = sptr::MakeSptr(info, nullptr); EXPECT_EQ(WSError::WS_OK, session1->Foreground(property, true)); @@ -224,7 +221,7 @@ HWTEST_F(SceneSessionLifecycleTest, Foreground06, Function | SmallTest | Level2) sptr session = sptr::MakeSptr(info, nullptr); EXPECT_NE(session, nullptr); - sptr property = nullptr; + sptr property = sptr::MakeSptr(); session->property_ = property; EXPECT_EQ(WSError::WS_OK, session->Foreground(property, false)); @@ -799,7 +796,7 @@ HWTEST_F(SceneSessionLifecycleTest, ConnectInner01, Function | SmallTest | Level result = sceneSession->ConnectInner(mockSessionStage, nullptr, nullptr, systemConfig, property, nullptr, -1, -1, "session1"); - ASSERT_EQ(result, WSError::WS_ERROR_NULLPTR); + ASSERT_EQ(result, WSError::WS_OK); result = sceneSession->ConnectInner(mockSessionStage, nullptr, nullptr, systemConfig, property, nullptr, -1, -1); diff --git a/window_scene/test/unittest/scene_session_test.cpp b/window_scene/test/unittest/scene_session_test.cpp index 8d7a3dbbdf986786f2c2b23bf2034ff8f06db8ca..a1a54fa6b37083581b80f46a33e448a89bd1ec77 100644 --- a/window_scene/test/unittest/scene_session_test.cpp +++ b/window_scene/test/unittest/scene_session_test.cpp @@ -2184,7 +2184,7 @@ HWTEST_F(SceneSessionTest, SetDefaultDisplayIdIfNeed, Function | SmallTest | Lev sptr property = sptr::MakeSptr();; EXPECT_NE(property, nullptr); - property->SetDisplayId(-99); + property->SetDisplayId(-1); sceneSession->SetSessionProperty(property); sceneSession->SetDefaultDisplayIdIfNeed(); EXPECT_EQ(property->GetDisplayId(), SCREEN_ID_INVALID); diff --git a/window_scene/test/unittest/scene_session_test3.cpp b/window_scene/test/unittest/scene_session_test3.cpp index dd3735e0a08df0147c53a19ab3c91901dd147340..363278df09a6d19eb48cba34e61c3c779ba9c7cb 100644 --- a/window_scene/test/unittest/scene_session_test3.cpp +++ b/window_scene/test/unittest/scene_session_test3.cpp @@ -780,7 +780,7 @@ HWTEST_F(SceneSessionTest3, CompatibleFullScreenClose, Function | SmallTest | Le sptr windowSessionProperty = sptr::MakeSptr(); sceneSession->property_ = windowSessionProperty; sceneSession->SetSessionState(SessionState::STATE_DISCONNECT); - ASSERT_EQ(WSError::WS_OK, sceneSession->CompatibleFullScreenClose()); + ASSERT_EQ(WSError::WS_ERROR_INVALID_SESSION, sceneSession->CompatibleFullScreenClose()); sceneSession->SetSessionState(SessionState::STATE_CONNECT); ASSERT_EQ(WSError::WS_OK, sceneSession->CompatibleFullScreenClose()); }