From b0167e0da67cbacb59c0feba9b416f67041bfdd2 Mon Sep 17 00:00:00 2001 From: l00574490 Date: Fri, 29 Jul 2022 16:01:24 +0800 Subject: [PATCH] delete drag st Signed-off-by: l00574490 Change-Id: Ib4ed536f32c87323cd47dce177d634323bf57822 --- test/systemtest/wms/BUILD.gn | 1 - test/systemtest/wms/window_split_test.cpp | 118 ---------------------- wm/test/unittest/window_impl_test.cpp | 54 ---------- 3 files changed, 173 deletions(-) diff --git a/test/systemtest/wms/BUILD.gn b/test/systemtest/wms/BUILD.gn index 4781e506..5fa615d7 100644 --- a/test/systemtest/wms/BUILD.gn +++ b/test/systemtest/wms/BUILD.gn @@ -31,7 +31,6 @@ group("systemtest") { ":wms_window_input_test", ":wms_window_layout_test", ":wms_window_mode_support_info_test", - ":wms_window_move_drag_test", ":wms_window_multi_ability_test", ":wms_window_occupied_area_change_test", ":wms_window_rotation_test", diff --git a/test/systemtest/wms/window_split_test.cpp b/test/systemtest/wms/window_split_test.cpp index cc72e245..80833bd7 100644 --- a/test/systemtest/wms/window_split_test.cpp +++ b/test/systemtest/wms/window_split_test.cpp @@ -207,124 +207,6 @@ HWTEST_F(WindowSplitTest, SplitScreen04, Function | MediumTest | Level3) ASSERT_EQ(WMError::WM_OK, secWindow->Hide()); sleep(SPLIT_TEST_SLEEP_S); } - -/** - * @tc.name: SplitScreen05 - * @tc.desc: forbid dock slice to move test - * @tc.type: FUNC - */ -HWTEST_F(WindowSplitTest, SplitScreen05, Function | MediumTest | Level3) -{ - fullInfo_.name = "fullscreen.5"; - splitInfo_.name = "primary.5"; - splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY; - - const sptr& fullWindow = Utils::CreateTestWindow(fullInfo_); - activeWindows_.push_back(fullWindow); - ASSERT_EQ(WMError::WM_OK, fullWindow->Show()); - sleep(SPLIT_TEST_SLEEP_S); - - const sptr& priWindow = Utils::CreateTestWindow(splitInfo_); - activeWindows_.push_back(priWindow); - ASSERT_EQ(WMError::WM_OK, priWindow->Show()); - sleep(SPLIT_TEST_SLEEP_S); - - ASSERT_EQ(WindowMode::WINDOW_MODE_SPLIT_SECONDARY, priWindow->GetMode()); - ASSERT_EQ(WindowMode::WINDOW_MODE_SPLIT_PRIMARY, fullWindow->GetMode()); - - Utils::TestWindowInfo dividerInfo; - dividerInfo.name = "divider0"; - dividerInfo.type = WindowType::WINDOW_TYPE_DOCK_SLICE; - dividerInfo.mode = WindowMode::WINDOW_MODE_FLOATING; - dividerInfo.focusable_ = false; - - const sptr& divider = Utils::CreateTestWindow(dividerInfo); - activeWindows_.push_back(divider); - ASSERT_EQ(WMError::WM_OK, divider->Show()); - sleep(SPLIT_TEST_SLEEP_S); - - Rect lastRect = divider->GetRect(); - WMError ret = divider->MoveTo(lastRect.posX_ + 10, lastRect.posY_ + 10); - sleep(SPLIT_TEST_SLEEP_S); - Rect rect = divider->GetRect(); - ASSERT_TRUE(lastRect.posX_ != rect.posX_ || lastRect.posY_ != rect.posY_); - - ret = fullWindow->AddWindowFlag(WindowFlag::WINDOW_FLAG_FORBID_SPLIT_MOVE); - sleep(SPLIT_TEST_SLEEP_S); - ret = divider->MoveTo(rect.posX_ + 10, rect.posY_ + 10); - sleep(SPLIT_TEST_SLEEP_S); - Rect NewRect = divider->GetRect(); - ASSERT_TRUE(rect.posX_ == NewRect.posX_ && rect.posY_ == NewRect.posY_); - - ASSERT_EQ(WMError::WM_OK, priWindow->Hide()); - sleep(SPLIT_TEST_SLEEP_S); - ASSERT_EQ(WMError::WM_OK, fullWindow->Hide()); - sleep(SPLIT_TEST_SLEEP_S); -} - -/** - * @tc.name: SplitScreen06 - * @tc.desc: split ratio test - * @tc.type: FUNC - */ -HWTEST_F(WindowSplitTest, SplitScreen06, Function | MediumTest | Level3) -{ - fullInfo_.name = "fullscreen.6"; - splitInfo_.name = "primary.6"; - splitInfo_.mode = WindowMode::WINDOW_MODE_SPLIT_SECONDARY; - - const sptr& fullWindow = Utils::CreateTestWindow(fullInfo_); - activeWindows_.push_back(fullWindow); - ASSERT_EQ(WMError::WM_OK, fullWindow->Show()); - sleep(SPLIT_TEST_SLEEP_S); - - const sptr& priWindow = Utils::CreateTestWindow(splitInfo_); - activeWindows_.push_back(priWindow); - ASSERT_EQ(WMError::WM_OK, priWindow->Show()); - sleep(SPLIT_TEST_SLEEP_S); - - Utils::TestWindowInfo dividerInfo; - dividerInfo.name = "divider0"; - dividerInfo.type = WindowType::WINDOW_TYPE_DOCK_SLICE; - dividerInfo.mode = WindowMode::WINDOW_MODE_FLOATING; - dividerInfo.focusable_ = false; - - const sptr& divider = Utils::CreateTestWindow(dividerInfo); - activeWindows_.push_back(divider); - ASSERT_EQ(WMError::WM_OK, divider->Show()); - sleep(SPLIT_TEST_SLEEP_S); - Rect rect = divider->GetRect(); - - uint32_t pointerId = 0; - int32_t posX, posY; - posX = posY = 0; - std::shared_ptr pointerEvent = - Utils::CreatePointerEvent(posX, posY, pointerId, MMI::PointerEvent::POINTER_ACTION_DOWN); - divider->ConsumePointerEvent(pointerEvent); - sleep(SPLIT_TEST_SLEEP_S); - - if (rect.width_ < rect.height_) { - posX += 10; - } else { - posY += 10; - } - pointerEvent = Utils::CreatePointerEvent(posX, posY, pointerId, MMI::PointerEvent::POINTER_ACTION_MOVE); - divider->ConsumePointerEvent(pointerEvent); - sleep(SPLIT_TEST_SLEEP_S); - Rect moveRect = divider->GetRect(); - ASSERT_TRUE(rect.posX_ != moveRect.posX_ || rect.posY_ != moveRect.posY_); - - pointerEvent = Utils::CreatePointerEvent(posX, posY, pointerId, MMI::PointerEvent::POINTER_ACTION_UP); - divider->ConsumePointerEvent(pointerEvent); - sleep(SPLIT_TEST_SLEEP_S); - Rect newRect = divider->GetRect(); - ASSERT_TRUE(rect.posX_ == newRect.posX_ && rect.posY_ == newRect.posY_); - - ASSERT_EQ(WMError::WM_OK, priWindow->Hide()); - sleep(SPLIT_TEST_SLEEP_S); - ASSERT_EQ(WMError::WM_OK, fullWindow->Hide()); - sleep(SPLIT_TEST_SLEEP_S); -} } } // namespace Rosen } // namespace OHOS diff --git a/wm/test/unittest/window_impl_test.cpp b/wm/test/unittest/window_impl_test.cpp index de6ef68f..eb3e37e3 100644 --- a/wm/test/unittest/window_impl_test.cpp +++ b/wm/test/unittest/window_impl_test.cpp @@ -850,60 +850,6 @@ HWTEST_F(WindowImplTest, GetColorSpace01, Function | SmallTest | Level3) ASSERT_EQ(WMError::WM_OK, window->Destroy()); } -/** - * @tc.name: MoveTo01 - * @tc.desc: create window but not show, move window, test rect - * @tc.type: FUNC - */ -HWTEST_F(WindowImplTest, MoveTo01, Function | SmallTest | Level3) -{ - sptr option = new WindowOption(); - option->SetWindowName("MoveTo01"); - option->SetWindowMode(WindowMode::WINDOW_MODE_FLOATING); - Rect winRect = {10, 20, 30u, 40u}; // set window rect: 10, 20, 30, 40 - option->SetWindowRect(winRect); - sptr window = new WindowImpl(option); - std::unique_ptr m = std::make_unique(); - - EXPECT_CALL(m->Mock(), CreateWindow(_, _, _, _, _)).Times(1).WillOnce(Return(WMError::WM_OK)); - ASSERT_EQ(WMError::WM_OK, window->Create("")); - ASSERT_EQ(WindowMode::WINDOW_MODE_FLOATING, window->GetMode()); - ASSERT_FALSE((window->GetWindowState() == WindowState::STATE_SHOWN)); - const float moveRatio = 0.5; - Rect newRect = {winRect.posX_ * moveRatio, winRect.posY_ * moveRatio, winRect.width_, winRect.height_}; - window->MoveTo(newRect.posX_, newRect.posY_); - ASSERT_EQ(newRect, window->GetRequestRect()); - EXPECT_CALL(m->Mock(), DestroyWindow(_)).Times(1).WillOnce(Return(WMError::WM_OK)); - ASSERT_EQ(WMError::WM_OK, window->Destroy()); -} - -/** - * @tc.name: Resize01 - * @tc.desc: create window but not show, resize window, test rect - * @tc.type: FUNC - */ -HWTEST_F(WindowImplTest, Resize01, Function | SmallTest | Level3) -{ - sptr option = new WindowOption(); - option->SetWindowName("Resize01"); - option->SetWindowMode(WindowMode::WINDOW_MODE_FLOATING); - Rect winRect = {10, 20, 30u, 40u}; // set window rect: 10, 20, 30, 40 - option->SetWindowRect(winRect); - sptr window = new WindowImpl(option); - std::unique_ptr m = std::make_unique(); - - EXPECT_CALL(m->Mock(), CreateWindow(_, _, _, _, _)).Times(1).WillOnce(Return(WMError::WM_OK)); - ASSERT_EQ(WMError::WM_OK, window->Create("")); - ASSERT_EQ(WindowMode::WINDOW_MODE_FLOATING, window->GetMode()); - ASSERT_FALSE((window->GetWindowState() == WindowState::STATE_SHOWN)); - const float resizeRatio = 0.5; - Rect newRect = {winRect.posX_, winRect.posY_, winRect.width_ * resizeRatio, winRect.height_ * resizeRatio}; - window->Resize(newRect.width_, newRect.height_); - ASSERT_EQ(newRect, window->GetRequestRect()); - EXPECT_CALL(m->Mock(), DestroyWindow(_)).Times(1).WillOnce(Return(WMError::WM_OK)); - ASSERT_EQ(WMError::WM_OK, window->Destroy()); -} - /** * @tc.name: StartMove01 * @tc.desc: start move main fullscreen window, test startMoveFlag