mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-18 16:24:27 -04:00
delete drag st
Signed-off-by: l00574490 <liuqi149@huawei.com> Change-Id: Ib4ed536f32c87323cd47dce177d634323bf57822
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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<Window>& fullWindow = Utils::CreateTestWindow(fullInfo_);
|
||||
activeWindows_.push_back(fullWindow);
|
||||
ASSERT_EQ(WMError::WM_OK, fullWindow->Show());
|
||||
sleep(SPLIT_TEST_SLEEP_S);
|
||||
|
||||
const sptr<Window>& 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<Window>& 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<Window>& fullWindow = Utils::CreateTestWindow(fullInfo_);
|
||||
activeWindows_.push_back(fullWindow);
|
||||
ASSERT_EQ(WMError::WM_OK, fullWindow->Show());
|
||||
sleep(SPLIT_TEST_SLEEP_S);
|
||||
|
||||
const sptr<Window>& 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<Window>& 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<MMI::PointerEvent> 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
|
||||
|
||||
@@ -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<WindowOption> 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<WindowImpl> window = new WindowImpl(option);
|
||||
std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
|
||||
|
||||
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<WindowOption> 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<WindowImpl> window = new WindowImpl(option);
|
||||
std::unique_ptr<Mocker> m = std::make_unique<Mocker>();
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user