Signed-off-by: pengyanggit yangpeng177@huawei.com

Signed-off-by: pengyanggit <yangpeng177@huawei.com>
Change-Id: I1b564fe13cfa21f48e875195458b688aa958ad58
This commit is contained in:
pengyanggit 2024-08-07 17:29:28 +08:00
parent 8431c40d16
commit fcf44ad599

View File

@ -1454,6 +1454,39 @@ HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_DragCornerRadius
ASSERT_EQ(ret, RET_OK);
ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
}
/**
* @tc.name: InteractionDragDrawingTest_RotateDragWindowSync
* @tc.desc: Rotate and drag the window to Synchronize
* @tc.type: FUNC
* @tc.require:
*/
HWTEST_F(InteractionDragDrawingTest, InteractionDragDrawingTest_RotateDragWindowSync, TestSize.Level1)
{
CALL_TEST_DEBUG;
std::optional<DragData> dragData = CreateDragData(
MMI::PointerEvent::SOURCE_TYPE_TOUCHSCREEN, POINTER_ID, DRAG_NUM_MULTIPLE, false, SHADOW_NUM_ONE);
ASSERT_TRUE(dragData);
std::promise<bool> promiseFlag;
std::future<bool> futureFlag = promiseFlag.get_future();
auto callback = [&promiseFlag](const DragNotifyMsg &notifyMessage) {
FI_HILOGD("displayX:%{public}d, displayY:%{public}d, result:%{public}d",
notifyMessage.displayX, notifyMessage.displayY, notifyMessage.result);
promiseFlag.set_value(true);
};
int32_t ret = InteractionManager::GetInstance()->StartDrag(dragData.value(),
std::make_shared<TestStartDragListener>(callback));
ASSERT_EQ(ret, RET_OK);
ret = InteractionManager::GetInstance()->SetDragWindowVisible(DRAG_WINDOW_VISIBLE);
ASSERT_EQ(ret, RET_OK);
std::shared_ptr<Rosen::RSTransaction>& rsTransaction { nullptr };
ASSERT_NO_FATAL_FAILURE(InteractionManager::GetInstance()->RotateDragWindowSync(rsTransaction));
DragDropResult dropResult { DragResult::DRAG_SUCCESS, HAS_CUSTOM_ANIMATION, WINDOW_ID };
ret = InteractionManager::GetInstance()->StopDrag(dropResult);
ASSERT_EQ(ret, RET_OK);
ASSERT_TRUE(futureFlag.wait_for(std::chrono::milliseconds(PROMISE_WAIT_SPAN_MS)) != std::future_status::timeout);
}
} // namespace DeviceStatus
} // namespace Msdp
} // namespace OHOS