mirror of
https://gitee.com/openharmony/msdp_device_status
synced 2024-11-23 15:40:16 +00:00
Signed-off-by: pengyanggit yangpeng177@huawei.com
Signed-off-by: pengyanggit <yangpeng177@huawei.com> Change-Id: I1b564fe13cfa21f48e875195458b688aa958ad58
This commit is contained in:
parent
8431c40d16
commit
fcf44ad599
@ -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 ¬ifyMessage) {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user