Function1214

Signed-off-by: yangjintao <yangjintao16@huawei.com>
Change-Id: I6ebd4343c74a1a29b72c4819186e2ecd8a64a260
This commit is contained in:
yangjintao 2023-12-14 02:19:05 +00:00
parent 2f2c251f7b
commit d6f9157543

View File

@ -74,6 +74,7 @@ constexpr int32_t FOREGROUND_COLOR_IN { 0x33FF0000 };
constexpr int32_t FOREGROUND_COLOR_OUT { 0x00000000 };
constexpr int32_t RADIUS_IN { 42 };
constexpr int32_t RADIUS_OUT { 42 };
constexpr int32_t ANIMATION_DURATION { 500 };
constexpr int64_t DOWN_TIME { 1 };
const std::string UD_KEY { "Unified data key" };
const std::string EXTRA_INFO { "{ \"drag_allow_distributed\" : false }" };
@ -121,7 +122,7 @@ public:
static void SimulateDownKeyEvent(int32_t key);
static void SimulateUpKeyEvent(int32_t key);
static void PrintDragAction(DragAction dragAction);
static void AssignToAnimationIn(PreviewAnimation &animationIn);
static void AssignToAnimation(PreviewAnimation &animation);
};
void InteractionManagerTest::SetPermission(const std::string &level, const char** perms, size_t permAmount)
@ -556,11 +557,11 @@ void InteractionManagerTest::PrintDragAction(DragAction dragAction)
}
}
void InteractionManagerTest::AssignToAnimationIn(PreviewAnimation &animationIn)
void InteractionManagerTest::AssignToAnimation(PreviewAnimation &animation)
{
animationIn.duration = 500;
animationIn.curveName = CURVE_NAME;
animationIn.curve = { 0.33, 0, 0.67, 1 };
animation.duration = ANIMATION_DURATION;
animation.curveName = CURVE_NAME;
animation.curve = { 0.33, 0, 0.67, 1 };
}
class InputEventCallbackTest : public MMI::IInputEventConsumer {
@ -1919,7 +1920,7 @@ HWTEST_F(InteractionManagerTest, InteractionManagerTest_UpdatePreviewStyleWithAn
previewStyleIn.foregroundColor = FOREGROUND_COLOR_IN;
previewStyleIn.radius = RADIUS_IN;
PreviewAnimation animationIn;
AssignToAnimationIn(animationIn);
AssignToAnimation(animationIn);
ret = InteractionManager::GetInstance()->UpdatePreviewStyleWithAnimation(previewStyleIn, animationIn);
EXPECT_EQ(ret, RET_OK);
SimulateMovePointerEvent({ enterPos.first, enterPos.second }, { leavePos.first, leavePos.second },
@ -1929,7 +1930,7 @@ HWTEST_F(InteractionManagerTest, InteractionManagerTest_UpdatePreviewStyleWithAn
previewStyleOut.foregroundColor = FOREGROUND_COLOR_OUT;
previewStyleOut.radius = RADIUS_OUT;
PreviewAnimation animationOut;
AssignToAnimationIn(animationIn);
AssignToAnimation(animationOut);
ret = InteractionManager::GetInstance()->UpdatePreviewStyleWithAnimation(previewStyleOut, animationOut);
EXPECT_EQ(ret, RET_OK);
SimulateMovePointerEvent({ leavePos.first, leavePos.second }, { DRAG_DST_X, DRAG_DST_Y },