From 69f25f7d4fc848aba707ccd832f8566be743d91d Mon Sep 17 00:00:00 2001 From: wlj Date: Wed, 13 Jul 2022 15:00:50 +0800 Subject: [PATCH] fix split st Signed-off-by: wlj Change-Id: I074a4ba33004b90f47431176240180c84fa0e9ca --- wm/test/systemtest/BUILD.gn | 2 ++ .../window_split_immersive_test.cpp | 8 +------ wm/test/systemtest/window_split_test.cpp | 23 ++++++++++--------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/wm/test/systemtest/BUILD.gn b/wm/test/systemtest/BUILD.gn index 910283cf..bcc80c2d 100644 --- a/wm/test/systemtest/BUILD.gn +++ b/wm/test/systemtest/BUILD.gn @@ -34,6 +34,8 @@ group("systemtest") { ":wm_window_multi_ability_test", ":wm_window_occupied_area_change_test", ":wm_window_rotation_test", + ":wm_window_split_immersive_test", + ":wm_window_split_test", ":wm_window_subwindow_test", ":wm_window_touch_outside_test", ":wm_window_visibility_info_test", diff --git a/wm/test/systemtest/window_split_immersive_test.cpp b/wm/test/systemtest/window_split_immersive_test.cpp index 7a899cb5..6424194c 100644 --- a/wm/test/systemtest/window_split_immersive_test.cpp +++ b/wm/test/systemtest/window_split_immersive_test.cpp @@ -92,6 +92,7 @@ namespace { HWTEST_F(WindowSplitImmersiveTest, SplitImmersive01, Function | MediumTest | Level3) { // create fullscreen win and show + fullInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY; const sptr& fullWindow = Utils::CreateTestWindow(fullInfo_); activeWindows_.push_back(fullWindow); ASSERT_EQ(WMError::WM_OK, fullWindow->Show()); @@ -112,13 +113,6 @@ HWTEST_F(WindowSplitImmersiveTest, SplitImmersive01, Function | MediumTest | Lev ASSERT_EQ(0, immersivePriRect.posY_); sleep(SPLIT_TEST_SLEEP_S); - // Exit split Mode. - ASSERT_EQ(WMError::WM_OK, priWindow->Hide()); - sleep(SPLIT_TEST_SLEEP_S); - - // check is out split Immersive - ASSERT_EQ(WindowMode::WINDOW_MODE_FULLSCREEN, fullWindow->GetMode()); - ASSERT_EQ(WMError::WM_OK, fullWindow->Hide()); sleep(SPLIT_TEST_SLEEP_S); ASSERT_EQ(WMError::WM_OK, priWindow->Hide()); diff --git a/wm/test/systemtest/window_split_test.cpp b/wm/test/systemtest/window_split_test.cpp index 18ce4183..cc72e245 100644 --- a/wm/test/systemtest/window_split_test.cpp +++ b/wm/test/systemtest/window_split_test.cpp @@ -50,7 +50,7 @@ void WindowSplitTest::SetUp() .name = "", .rect = Utils::customAppRect_, .type = WindowType::WINDOW_TYPE_APP_MAIN_WINDOW, - .mode = WindowMode::WINDOW_MODE_FULLSCREEN, + .mode = WindowMode::WINDOW_MODE_SPLIT_PRIMARY, .needAvoid = true, .parentLimit = false, .parentName = "", @@ -80,12 +80,13 @@ void WindowSplitTest::TearDown() namespace { /** * @tc.name: SplitWindow01 - * @tc.desc: one primary window and one fullscreen window, test mode change + * @tc.desc: first create a secondary window, then create a primary window, test mode change * @tc.type: FUNC */ HWTEST_F(WindowSplitTest, SplitWindow01, Function | MediumTest | Level3) { fullInfo_.name = "fullscreen.1"; + fullInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY; splitInfo_.name = "primary.1"; splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_PRIMARY; @@ -111,12 +112,13 @@ HWTEST_F(WindowSplitTest, SplitWindow01, Function | MediumTest | Level3) /** * @tc.name: SplitWindow02 - * @tc.desc: one secondary window and one fullscreen window, test mode change + * @tc.desc: first create a primary window, then create a secondary window, test mode change * @tc.type: FUNC */ HWTEST_F(WindowSplitTest, SplitWindow02, Function | MediumTest | Level3) { fullInfo_.name = "fullscreen.2"; + fullInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_PRIMARY; splitInfo_.name = "secondary.2"; splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY; @@ -141,12 +143,13 @@ HWTEST_F(WindowSplitTest, SplitWindow02, Function | MediumTest | Level3) /** * @tc.name: SplitScreen03 - * @tc.desc: one primary window and one fullscreen window, test rects + * @tc.desc: first create a secondary window, then create a primary window, test rects * @tc.type: FUNC */ HWTEST_F(WindowSplitTest, SplitScreen03, Function | MediumTest | Level3) { fullInfo_.name = "fullscreen.3"; + fullInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY; splitInfo_.name = "primary.3"; splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_PRIMARY; @@ -174,7 +177,7 @@ HWTEST_F(WindowSplitTest, SplitScreen03, Function | MediumTest | Level3) /** * @tc.name: SplitScreen04 - * @tc.desc: one secondary window and one fullscreen window, test rects + * @tc.desc: first create a primary window, then create a secondary window, test rects * @tc.type: FUNC */ HWTEST_F(WindowSplitTest, SplitScreen04, Function | MediumTest | Level3) @@ -214,7 +217,7 @@ HWTEST_F(WindowSplitTest, SplitScreen05, Function | MediumTest | Level3) { fullInfo_.name = "fullscreen.5"; splitInfo_.name = "primary.5"; - splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_PRIMARY; + splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY; const sptr& fullWindow = Utils::CreateTestWindow(fullInfo_); activeWindows_.push_back(fullWindow); @@ -226,8 +229,8 @@ HWTEST_F(WindowSplitTest, SplitScreen05, Function | MediumTest | Level3) ASSERT_EQ(WMError::WM_OK, priWindow->Show()); sleep(SPLIT_TEST_SLEEP_S); - ASSERT_EQ(WindowMode::WINDOW_MODE_SPLIT_PRIMARY, priWindow->GetMode()); - ASSERT_EQ(WindowMode::WINDOW_MODE_SPLIT_SECONDARY, fullWindow->GetMode()); + ASSERT_EQ(WindowMode::WINDOW_MODE_SPLIT_SECONDARY, priWindow->GetMode()); + ASSERT_EQ(WindowMode::WINDOW_MODE_SPLIT_PRIMARY, fullWindow->GetMode()); Utils::TestWindowInfo dividerInfo; dividerInfo.name = "divider0"; @@ -255,7 +258,6 @@ HWTEST_F(WindowSplitTest, SplitScreen05, Function | MediumTest | Level3) ASSERT_EQ(WMError::WM_OK, priWindow->Hide()); sleep(SPLIT_TEST_SLEEP_S); - ASSERT_EQ(WindowMode::WINDOW_MODE_FULLSCREEN, fullWindow->GetMode()); ASSERT_EQ(WMError::WM_OK, fullWindow->Hide()); sleep(SPLIT_TEST_SLEEP_S); } @@ -269,7 +271,7 @@ HWTEST_F(WindowSplitTest, SplitScreen06, Function | MediumTest | Level3) { fullInfo_.name = "fullscreen.6"; splitInfo_.name = "primary.6"; - splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_PRIMARY; + splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY; const sptr& fullWindow = Utils::CreateTestWindow(fullInfo_); activeWindows_.push_back(fullWindow); @@ -320,7 +322,6 @@ HWTEST_F(WindowSplitTest, SplitScreen06, Function | MediumTest | Level3) ASSERT_EQ(WMError::WM_OK, priWindow->Hide()); sleep(SPLIT_TEST_SLEEP_S); - ASSERT_EQ(WindowMode::WINDOW_MODE_FULLSCREEN, fullWindow->GetMode()); ASSERT_EQ(WMError::WM_OK, fullWindow->Hide()); sleep(SPLIT_TEST_SLEEP_S); }