diff --git a/frameworks/core/interfaces/native/implementation/base_gesture_event_peer.h b/frameworks/core/interfaces/native/implementation/base_gesture_event_peer.h index a97c066cbb510667c09211f2df82ff462063d9a6..d7d46de74f5b15c66580f8a09e7f9b551a6a882d 100644 --- a/frameworks/core/interfaces/native/implementation/base_gesture_event_peer.h +++ b/frameworks/core/interfaces/native/implementation/base_gesture_event_peer.h @@ -81,4 +81,16 @@ protected: ~BaseGestureEventPeerImpl() override = default; friend PeerUtils; }; + +template, bool> = true, + std::enable_if_t, bool> = true> +static BaseGestureEventPeer* CreateGestureEventPeer(const std::shared_ptr& info) +{ + auto event = TypeInfoHelper::DynamicCast(info.get()); + CHECK_NULL_RETURN(event, nullptr); + auto peer = PeerUtils::CreatePeer(); + peer->SetEventInfo(std::static_pointer_cast(info)); + return peer; +} } // namespace OHOS::Ace::NG::GeneratedModifier diff --git a/frameworks/core/interfaces/native/implementation/common_method_modifier.cpp b/frameworks/core/interfaces/native/implementation/common_method_modifier.cpp index 6753350081a69b9abc8792a36e8fbf4b25867282..40b8bdebc928fa96bfca171689b218b93713717b 100644 --- a/frameworks/core/interfaces/native/implementation/common_method_modifier.cpp +++ b/frameworks/core/interfaces/native/implementation/common_method_modifier.cpp @@ -47,6 +47,7 @@ #include "core/interfaces/native/utility/validators.h" #include "core/interfaces/native/utility/callback_helper.h" #include "core/interfaces/native/generated/interface/ui_node_api.h" +#include "core/interfaces/native/implementation/base_gesture_event_peer.h" #include "core/interfaces/native/implementation/color_metrics_peer.h" #include "core/interfaces/native/implementation/dismiss_popup_action_peer.h" #include "core/interfaces/native/implementation/drag_event_peer.h" @@ -159,51 +160,39 @@ Ark_GestureRecognizer CreateArkGestureRecognizer(const RefPtr& info, GestureTypeName typeName) { - Ark_BaseGestureEvent peer = nullptr; + BaseGestureEventPeer* peer = nullptr; switch (typeName) { case OHOS::Ace::GestureTypeName::TAP_GESTURE: { - auto tapGestureEvent = TypeInfoHelper::DynamicCast(info.get()); - CHECK_NULL_RETURN(tapGestureEvent, peer); - peer = Converter::ArkValue(info); + peer = GeneratedModifier::CreateGestureEventPeer(info); break; } case OHOS::Ace::GestureTypeName::LONG_PRESS_GESTURE: { - auto longPressGestureEvent = TypeInfoHelper::DynamicCast(info.get()); - CHECK_NULL_RETURN(longPressGestureEvent, peer); - peer = Converter::ArkValue(info); + peer = GeneratedModifier::CreateGestureEventPeer(info); break; } case OHOS::Ace::GestureTypeName::PAN_GESTURE: { - auto panGestureEvent = TypeInfoHelper::DynamicCast(info.get()); - CHECK_NULL_RETURN(panGestureEvent, peer); - peer = Converter::ArkValue(info); + peer = GeneratedModifier::CreateGestureEventPeer(info); break; } case OHOS::Ace::GestureTypeName::PINCH_GESTURE: { - auto pinchGestureEvent = TypeInfoHelper::DynamicCast(info.get()); - CHECK_NULL_RETURN(pinchGestureEvent, peer); - peer = Converter::ArkValue(info); + peer = GeneratedModifier::CreateGestureEventPeer(info); break; } case OHOS::Ace::GestureTypeName::ROTATION_GESTURE: { - auto rotationGestureEvent = TypeInfoHelper::DynamicCast(info.get()); - CHECK_NULL_RETURN(rotationGestureEvent, peer); - peer = Converter::ArkValue(info); + peer = GeneratedModifier::CreateGestureEventPeer(info); break; } case OHOS::Ace::GestureTypeName::SWIPE_GESTURE: { - auto swipeGestureEvent = TypeInfoHelper::DynamicCast(info.get()); - CHECK_NULL_RETURN(swipeGestureEvent, peer); - peer = Converter::ArkValue(info); + peer = GeneratedModifier::CreateGestureEventPeer(info); break; } default: - peer = Converter::ArkValue(info); + peer = GeneratedModifier::CreateGestureEventPeer(info); break; } - if (peer) { - peer->SetRecognizerType(typeName); - } + CHECK_NULL_RETURN(peer, nullptr); + peer->SetRecognizerType(typeName); return peer; } } diff --git a/frameworks/core/interfaces/native/implementation/long_press_gesture_event_peer.h b/frameworks/core/interfaces/native/implementation/long_press_gesture_event_peer.h index ae2c556890a09383dbe1fb9c8644face620fb136..74cfca319a208f4ecfea0692f5ae7c325178a512 100644 --- a/frameworks/core/interfaces/native/implementation/long_press_gesture_event_peer.h +++ b/frameworks/core/interfaces/native/implementation/long_press_gesture_event_peer.h @@ -17,7 +17,8 @@ #include "core/interfaces/native/implementation/base_gesture_event_peer.h" -struct LongPressGestureEventPeer : public OHOS::Ace::NG::GeneratedModifier::BaseGestureEventPeerImpl { +struct LongPressGestureEventPeer + : public OHOS::Ace::NG::GeneratedModifier::SomeGestureEventPeer { protected: LongPressGestureEventPeer() = default; ~LongPressGestureEventPeer() override = default; diff --git a/frameworks/core/interfaces/native/implementation/pan_gesture_event_peer.h b/frameworks/core/interfaces/native/implementation/pan_gesture_event_peer.h index f9aefa4faa0743f1c8900803a57b91be34f3af45..34f09a4e97385140d9c3cdb5725fe4f7e53e6d18 100644 --- a/frameworks/core/interfaces/native/implementation/pan_gesture_event_peer.h +++ b/frameworks/core/interfaces/native/implementation/pan_gesture_event_peer.h @@ -17,7 +17,7 @@ #include "core/interfaces/native/implementation/base_gesture_event_peer.h" -struct PanGestureEventPeer : public OHOS::Ace::NG::GeneratedModifier::BaseGestureEventPeerImpl { +struct PanGestureEventPeer : public OHOS::Ace::NG::GeneratedModifier::SomeGestureEventPeer { protected: PanGestureEventPeer() = default; ~PanGestureEventPeer() override = default; diff --git a/frameworks/core/interfaces/native/implementation/pinch_gesture_event_peer.h b/frameworks/core/interfaces/native/implementation/pinch_gesture_event_peer.h index 8cfec4fa6303ce1d40ca6f80a58630ddc2d407bd..0e7f56df8ff2c1193082858b542d823498efbbca 100644 --- a/frameworks/core/interfaces/native/implementation/pinch_gesture_event_peer.h +++ b/frameworks/core/interfaces/native/implementation/pinch_gesture_event_peer.h @@ -17,7 +17,8 @@ #include "core/interfaces/native/implementation/base_gesture_event_peer.h" -struct PinchGestureEventPeer : public OHOS::Ace::NG::GeneratedModifier::BaseGestureEventPeerImpl { +struct PinchGestureEventPeer : + public OHOS::Ace::NG::GeneratedModifier::SomeGestureEventPeer { protected: PinchGestureEventPeer() = default; ~PinchGestureEventPeer() override = default; diff --git a/frameworks/core/interfaces/native/implementation/rotation_gesture_event_peer.h b/frameworks/core/interfaces/native/implementation/rotation_gesture_event_peer.h index 85fb13ab9129775aa94ef9263a2a77c889df15e3..785bcd9e40dc293c2033c42896c32e383867fe48 100644 --- a/frameworks/core/interfaces/native/implementation/rotation_gesture_event_peer.h +++ b/frameworks/core/interfaces/native/implementation/rotation_gesture_event_peer.h @@ -17,7 +17,8 @@ #include "core/interfaces/native/implementation/base_gesture_event_peer.h" -struct RotationGestureEventPeer : public OHOS::Ace::NG::GeneratedModifier::BaseGestureEventPeerImpl { +struct RotationGestureEventPeer + : public OHOS::Ace::NG::GeneratedModifier::SomeGestureEventPeer { protected: RotationGestureEventPeer() = default; ~RotationGestureEventPeer() override = default; diff --git a/frameworks/core/interfaces/native/implementation/swipe_gesture_event_peer.h b/frameworks/core/interfaces/native/implementation/swipe_gesture_event_peer.h index eec43289ef143f35fae5101bfdfe213b80bf2ed7..b28078a1c5c019de236195ac1592916f4f078698 100644 --- a/frameworks/core/interfaces/native/implementation/swipe_gesture_event_peer.h +++ b/frameworks/core/interfaces/native/implementation/swipe_gesture_event_peer.h @@ -17,7 +17,8 @@ #include "core/interfaces/native/implementation/base_gesture_event_peer.h" -struct SwipeGestureEventPeer : public OHOS::Ace::NG::GeneratedModifier::BaseGestureEventPeerImpl { +struct SwipeGestureEventPeer + : public OHOS::Ace::NG::GeneratedModifier::SomeGestureEventPeer { protected: SwipeGestureEventPeer() = default; ~SwipeGestureEventPeer() override = default; diff --git a/frameworks/core/interfaces/native/implementation/tap_gesture_event_peer.h b/frameworks/core/interfaces/native/implementation/tap_gesture_event_peer.h index 4ec492839c1cc81a42b04f0d31aaa5c76d65de3f..fa5534e635241e45599ce40cdbc8a9ff78290a1f 100644 --- a/frameworks/core/interfaces/native/implementation/tap_gesture_event_peer.h +++ b/frameworks/core/interfaces/native/implementation/tap_gesture_event_peer.h @@ -17,7 +17,8 @@ #include "core/interfaces/native/implementation/base_gesture_event_peer.h" -struct TapGestureEventPeer : public OHOS::Ace::NG::GeneratedModifier::BaseGestureEventPeerImpl { +struct TapGestureEventPeer + : public OHOS::Ace::NG::GeneratedModifier::SomeGestureEventPeer { protected: TapGestureEventPeer() = default; ~TapGestureEventPeer() override = default; diff --git a/frameworks/core/interfaces/native/utility/reverse_converter.cpp b/frameworks/core/interfaces/native/utility/reverse_converter.cpp index e51b084badc09e3904c1a0fd0ac2a1fe00152f4c..f7e700dc5ebf32b9af953c9c3a9255bfa2e8295f 100644 --- a/frameworks/core/interfaces/native/utility/reverse_converter.cpp +++ b/frameworks/core/interfaces/native/utility/reverse_converter.cpp @@ -115,62 +115,6 @@ void AssignArkValue(Ark_Area& dst, const BaseEventInfo& src) dst.height = Converter::ArkValue(src.GetTarget().area.GetHeight().ConvertToVp()); } -void AssignArkValue(Ark_BaseGestureEvent& dst, const std::shared_ptr& src) -{ - const auto peer = reinterpret_cast( - GeneratedModifier::GetFullAPI()->getAccessors()->getBaseGestureEventAccessor()->ctor()); - peer->SetEventInfo(src); - dst = peer; -} - -void AssignArkValue(Ark_TapGestureEvent& dst, const std::shared_ptr& src) -{ - dst = PeerUtils::CreatePeer(); - if (dst) { - dst->SetEventInfo(src); - } -} - -void AssignArkValue(Ark_LongPressGestureEvent& dst, const std::shared_ptr& src) -{ - dst = PeerUtils::CreatePeer(); - if (dst) { - dst->SetEventInfo(src); - } -} - -void AssignArkValue(Ark_PanGestureEvent& dst, const std::shared_ptr& src) -{ - dst = PeerUtils::CreatePeer(); - if (dst) { - dst->SetEventInfo(src); - } -} - -void AssignArkValue(Ark_PinchGestureEvent& dst, const std::shared_ptr& src) -{ - dst = PeerUtils::CreatePeer(); - if (dst) { - dst->SetEventInfo(src); - } -} - -void AssignArkValue(Ark_RotationGestureEvent& dst, const std::shared_ptr& src) -{ - dst = PeerUtils::CreatePeer(); - if (dst) { - dst->SetEventInfo(src); - } -} - -void AssignArkValue(Ark_SwipeGestureEvent& dst, const std::shared_ptr& src) -{ - dst = PeerUtils::CreatePeer(); - if (dst) { - dst->SetEventInfo(src); - } -} - void AssignArkValue(Ark_CaretOffset& dst, const NG::OffsetF& src) { dst.index = Converter::ArkValue(0); diff --git a/frameworks/core/interfaces/native/utility/reverse_converter.h b/frameworks/core/interfaces/native/utility/reverse_converter.h index 2dd690a8bc0ac1ac9bee03f5ca0d0246ccd4d9e1..5ec88fbf9146f3dd2fde84f807e374b1a4391b49 100644 --- a/frameworks/core/interfaces/native/utility/reverse_converter.h +++ b/frameworks/core/interfaces/native/utility/reverse_converter.h @@ -186,13 +186,6 @@ namespace OHOS::Ace::NG::Converter { void AssignArkValue(Ark_BarMode& dst, const TabBarMode& src); void AssignArkValue(Ark_BarPosition& dst, const BarPosition& src); void AssignArkValue(Ark_BarState& dst, const DisplayMode& src); - void AssignArkValue(Ark_BaseGestureEvent& dst, const std::shared_ptr& src); - void AssignArkValue(Ark_TapGestureEvent& dst, const std::shared_ptr& src); - void AssignArkValue(Ark_LongPressGestureEvent& dst, const std::shared_ptr& src); - void AssignArkValue(Ark_PanGestureEvent& dst, const std::shared_ptr& src); - void AssignArkValue(Ark_PinchGestureEvent& dst, const std::shared_ptr& src); - void AssignArkValue(Ark_RotationGestureEvent& dst, const std::shared_ptr& src); - void AssignArkValue(Ark_SwipeGestureEvent& dst, const std::shared_ptr& src); void AssignArkValue(Ark_BlurStyle& dst, const BlurStyle& src); void AssignArkValue(Ark_BorderRadiuses& dst, const BorderRadiusProperty& src); void AssignArkValue(Ark_Buffer& dst, const std::string& src); diff --git a/test/unittest/capi/accessors/pan_gesture_event_accessor_test.cpp b/test/unittest/capi/accessors/pan_gesture_event_accessor_test.cpp index 922b46004007bd5203bd278b792a39c44284bfa6..c5114e7a1a6f2c169926c423ac8ea0631a12e7e4 100755 --- a/test/unittest/capi/accessors/pan_gesture_event_accessor_test.cpp +++ b/test/unittest/capi/accessors/pan_gesture_event_accessor_test.cpp @@ -53,7 +53,7 @@ HWTEST_F(PanGestureEventAccessorTest, GetOffsetXTest, TestSize.Level1) { PipelineBase::GetCurrentDensity(); for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumberDoubleValues) { - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); event->SetOffsetX(Converter::Convert(value) * TEST_DENSITY); auto arkRes = Converter::Convert(accessor_->getOffsetX(peer_)); @@ -71,7 +71,7 @@ HWTEST_F(PanGestureEventAccessorTest, SetOffsetXTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumber_2x_Values) { accessor_->setOffsetX(peer_, &value); - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); EXPECT_NEAR(event->GetOffsetX(), expected, EPSILON) << "Input value is: " << input << ", method: SetOffsetX"; @@ -86,7 +86,7 @@ HWTEST_F(PanGestureEventAccessorTest, SetOffsetXTest, TestSize.Level1) HWTEST_F(PanGestureEventAccessorTest, GetOffsetYTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumberDoubleValues) { - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); event->SetOffsetY(Converter::Convert(value) * TEST_DENSITY); auto arkRes = Converter::Convert(accessor_->getOffsetY(peer_)); @@ -104,7 +104,7 @@ HWTEST_F(PanGestureEventAccessorTest, SetOffsetYTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumber_2x_Values) { accessor_->setOffsetY(peer_, &value); - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); EXPECT_NEAR(event->GetOffsetY(), expected, EPSILON) << "Input value is: " << input << ", method: SetOffsetY"; @@ -120,7 +120,7 @@ HWTEST_F(PanGestureEventAccessorTest, GetVelocityXTest, TestSize.Level1) { const double velocityY = 2.3; for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumberDoubleValues) { - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); auto offsetPerSec = Offset(Converter::Convert(value) * TEST_DENSITY, velocityY); event->SetVelocity(Velocity(offsetPerSec)); @@ -139,7 +139,7 @@ HWTEST_F(PanGestureEventAccessorTest, SetVelocityXTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumber_2x_Values) { accessor_->setVelocityX(peer_, &value); - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); EXPECT_NEAR(event->GetVelocity().GetVelocityX(), expected, EPSILON) << "Input value is: " << input << ", method: SetVelocityX"; @@ -155,7 +155,7 @@ HWTEST_F(PanGestureEventAccessorTest, GetVelocityYTest, TestSize.Level1) { const double velocityX = 2.3; for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumberDoubleValues) { - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); auto offsetPerSec = Offset(velocityX, Converter::Convert(value) * TEST_DENSITY); event->SetVelocity(Velocity(offsetPerSec)); @@ -174,7 +174,7 @@ HWTEST_F(PanGestureEventAccessorTest, SetVelocityYTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumber_2x_Values) { accessor_->setVelocityY(peer_, &value); - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); EXPECT_NEAR(event->GetVelocity().GetVelocityY(), expected, EPSILON) << "Input value is: " << input << ", method: SetVelocityY"; @@ -189,7 +189,7 @@ HWTEST_F(PanGestureEventAccessorTest, SetVelocityYTest, TestSize.Level1) HWTEST_F(PanGestureEventAccessorTest, GetVelocityTest, TestSize.Level1) { for (auto& [input, velocityX, velocityY, expected] : AccessorTestFixtures::testFixtureVelocity_half_Values) { - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); auto offsetPerSec = Offset(velocityX, velocityY); event->SetVelocity(Velocity(offsetPerSec)); @@ -208,7 +208,7 @@ HWTEST_F(PanGestureEventAccessorTest, SetVelocityTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumber_2x_Values) { accessor_->setVelocity(peer_, &value); - PanGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); EXPECT_NEAR(event->GetVelocity().GetVelocityX(), expected, EPSILON) << "Input X value is: " << input << ", method: SetVelocity"; diff --git a/test/unittest/capi/accessors/pinch_gesture_event_accessor_test.cpp b/test/unittest/capi/accessors/pinch_gesture_event_accessor_test.cpp index be69bb335952403da92e13592135af4a2a86a0d1..fe031875e8cdba73cc1e033677365a1c77f95f9c 100644 --- a/test/unittest/capi/accessors/pinch_gesture_event_accessor_test.cpp +++ b/test/unittest/capi/accessors/pinch_gesture_event_accessor_test.cpp @@ -49,7 +49,7 @@ namespace { HWTEST_F(PinchGestureEventAccessorTest, GetScaleTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureDoubleArkInt32Values) { - PinchGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); event->SetScale(value); auto arkRes = Converter::Convert(accessor_->getScale(peer_)); @@ -67,7 +67,7 @@ HWTEST_F(PinchGestureEventAccessorTest, SetScaleTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumberValues) { accessor_->setScale(peer_, &value); - PinchGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); EXPECT_NEAR(event->GetScale(), expected, EPSILON) << "Input value is: " << input << ", method: SetScale"; @@ -82,7 +82,7 @@ HWTEST_F(PinchGestureEventAccessorTest, SetScaleTest, TestSize.Level1) HWTEST_F(PinchGestureEventAccessorTest, GetPinchCenterXTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureDoubleArkInt32_half_Values) { - PinchGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); event->SetPinchCenter(Offset(value, 0.)); auto arkRes = Converter::Convert(accessor_->getPinchCenterX(peer_)); @@ -100,7 +100,7 @@ HWTEST_F(PinchGestureEventAccessorTest, SetPinchCenterXTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumber_2x_Values) { accessor_->setPinchCenterX(peer_, &value); - PinchGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); EXPECT_NEAR(event->GetPinchCenter().GetX(), expected, EPSILON) << "Input value is: " << input << ", method: SetPinchCenterX"; @@ -115,7 +115,7 @@ HWTEST_F(PinchGestureEventAccessorTest, SetPinchCenterXTest, TestSize.Level1) HWTEST_F(PinchGestureEventAccessorTest, GetPinchCenterYTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureDoubleArkInt32_half_Values) { - PinchGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); event->SetPinchCenter(Offset(0., value)); auto arkRes = Converter::Convert(accessor_->getPinchCenterY(peer_)); @@ -133,7 +133,7 @@ HWTEST_F(PinchGestureEventAccessorTest, SetPinchCenterYTest, TestSize.Level1) { for (auto& [input, value, expected] : AccessorTestFixtures::testFixtureNumber_2x_Values) { accessor_->setPinchCenterY(peer_, &value); - PinchGestureEvent* event = peer_->GetEventInfo(); + auto event = peer_->GetEventInfo(); ASSERT_NE(event, nullptr); EXPECT_NEAR(event->GetPinchCenter().GetY(), expected, EPSILON) << "Input value is: " << input << ", method: SetPinchCenterY"; diff --git a/test/unittest/capi/accessors/touch_event_accessor_test.cpp b/test/unittest/capi/accessors/touch_event_accessor_test.cpp index c2073d7f1fadeb470e914a2ad31e3fc03e068994..b3062b90646215d47aa389010859ad7939d31407 100644 --- a/test/unittest/capi/accessors/touch_event_accessor_test.cpp +++ b/test/unittest/capi/accessors/touch_event_accessor_test.cpp @@ -156,8 +156,6 @@ HWTEST_F(TouchEventAccessorTest, DISABLED_GetHistoricalPointsTest, TestSize.Leve ASSERT_NE(history.array, nullptr); EXPECT_EQ(Converter::Convert(history.array->touchObject.displayX), expectedDisplayX); EXPECT_EQ(Converter::Convert(history.array->touchObject.displayY), expectedDisplayY); - EXPECT_EQ(Converter::Convert(history.array->touchObject.screenX), expectedWindowX); - EXPECT_EQ(Converter::Convert(history.array->touchObject.screenY), expectedWindowY); EXPECT_EQ(Converter::Convert(history.array->touchObject.windowX), expectedWindowX); EXPECT_EQ(Converter::Convert(history.array->touchObject.windowY), expectedWindowY); EXPECT_EQ(Converter::Convert(history.array->touchObject.x), expectedX); @@ -204,8 +202,6 @@ HWTEST_F(TouchEventAccessorTest, DISABLED_GetTouchesTest, TestSize.Level1) ASSERT_NE(touches.array, nullptr); EXPECT_EQ(Converter::Convert(touches.array->displayX), expectedDisplayX); EXPECT_EQ(Converter::Convert(touches.array->displayY), expectedDisplayY); - EXPECT_EQ(Converter::Convert(touches.array->screenX), expectedWindowX); - EXPECT_EQ(Converter::Convert(touches.array->screenY), expectedWindowY); EXPECT_EQ(Converter::Convert(touches.array->windowX), expectedWindowX); EXPECT_EQ(Converter::Convert(touches.array->windowY), expectedWindowY); EXPECT_EQ(Converter::Convert(touches.array->x), expectedX); @@ -249,8 +245,6 @@ HWTEST_F(TouchEventAccessorTest, DISABLED_GetChangedTouchesTest, TestSize.Level1 ASSERT_NE(touches.array, nullptr); EXPECT_EQ(Converter::Convert(touches.array->displayX), expectedDisplayX); EXPECT_EQ(Converter::Convert(touches.array->displayY), expectedDisplayY); - EXPECT_EQ(Converter::Convert(touches.array->screenX), expectedWindowX); - EXPECT_EQ(Converter::Convert(touches.array->screenY), expectedWindowY); EXPECT_EQ(Converter::Convert(touches.array->windowX), expectedWindowX); EXPECT_EQ(Converter::Convert(touches.array->windowY), expectedWindowY); EXPECT_EQ(Converter::Convert(touches.array->x), expectedX);