X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-PushButton.cpp;h=edaf7fd3819fc1213ee6e8b99963ee261fa8d9ba;hb=ad2c68be894854b5dd91295039afebc21e659c3a;hp=e23dbe3b5ba436f35922b18e41e65c210f200750;hpb=36a298758d1b6244b7846a0102b528d76002dbda;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp index e23dbe3..edaf7fd 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp @@ -38,13 +38,38 @@ bool PushButtonSelected( Button button, bool selected ) } -const Dali::TouchPoint pointDownInside( 0, TouchPoint::Down, 240, 400 ); -const Dali::TouchPoint pointUpInside( 0, TouchPoint::Up, 240, 400 ); -const Dali::TouchPoint pointLeave( 0, TouchPoint::Leave, 240, 400 ); -const Dali::TouchPoint pointEnter( 0, TouchPoint::Motion, 240, 400 ); -const Dali::TouchPoint pointMotionOut( 0, TouchPoint::Motion, 10, 10 ); -const Dali::TouchPoint pointDownOutside( 0, TouchPoint::Down, 10, 10 ); -const Dali::TouchPoint pointUpOutside( 0, TouchPoint::Up, 10, 10 ); +Dali::Integration::Point GetPointDownInside() +{ + Dali::Integration::Point point; + point.SetState( PointState::DOWN ); + point.SetScreenPosition( Vector2( 240, 400 ) ); + return point; +} + +Dali::Integration::Point GetPointUpInside() +{ + Dali::Integration::Point point; + point.SetState( PointState::UP ); + point.SetScreenPosition( Vector2( 240, 400 ) ); + return point; +} + +Dali::Integration::Point GetPointMotionOut() +{ + Dali::Integration::Point point; + point.SetState( PointState::MOTION ); + point.SetScreenPosition( Vector2( 10, 10 ) ); + return point; +} + +Dali::Integration::Point GetPointUpOutside() +{ + Dali::Integration::Point point; + point.SetState( PointState::UP ); + point.SetScreenPosition( Vector2( 10, 10 ) ); + return point; +} + } // namespace @@ -304,7 +329,7 @@ public: Test mTest; }; -static bool TestCallback(Actor actor, const TouchEvent& event) +static bool TestCallback(Actor actor, const TouchData& event) { return true; } @@ -359,7 +384,7 @@ int UtcDaliPushButtonInterruptEventWhenInsensitive(void) // * Actor's touch event is connected to a callback function // and this callback function consumes the event. - actor.TouchedSignal().Connect( &TestCallback ); + actor.TouchSignal().Connect( &TestCallback ); // * Button's pressed signal is connected to a callback function // which also consumes the event. @@ -385,7 +410,7 @@ int UtcDaliPushButtonInterruptEventWhenInsensitive(void) // A down event is sent inside the button's boundary. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDownInside ); + event.AddPoint( GetPointDownInside() ); // flush the queue and render once application.SendNotification(); @@ -395,7 +420,7 @@ int UtcDaliPushButtonInterruptEventWhenInsensitive(void) // An up event is sent outside the button's boundary but inside the actor's one. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointUpOutside ); + event.AddPoint( GetPointUpOutside() ); // flush the queue and render once application.SendNotification(); @@ -419,7 +444,7 @@ int UtcDaliPushButtonInterruptEventWhenInsensitive(void) // A down event is sent inside the button's boundary. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDownInside ); + event.AddPoint( GetPointDownInside() ); // flush the queue and render once application.SendNotification(); @@ -429,7 +454,7 @@ int UtcDaliPushButtonInterruptEventWhenInsensitive(void) // A motion event is sent outside the button's boundary but inside the actor's one. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointMotionOut ); + event.AddPoint( GetPointMotionOut() ); // flush the queue and render once application.SendNotification(); @@ -449,7 +474,7 @@ int UtcDaliPushButtonInterruptEventWhenInsensitive(void) // A down event is sent inside the button's boundary. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDownInside ); + event.AddPoint( GetPointDownInside() ); // flush the queue and render once application.SendNotification(); @@ -460,7 +485,7 @@ int UtcDaliPushButtonInterruptEventWhenInsensitive(void) // An up event is sent inside the button's boundary. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointUpInside ); + event.AddPoint( GetPointUpInside() ); // flush the queue and render once application.SendNotification(); @@ -502,7 +527,7 @@ int UtcDaliPushButtonInterruptEventWhenNonVisible(void) // * Actor's touch event is connected to a callback function // and this callback function consumes the event. - actor.TouchedSignal().Connect( &TestCallback ); + actor.TouchSignal().Connect( &TestCallback ); // * Button's pressed signal is connected to a callback function // which also consumes the event. @@ -528,7 +553,7 @@ int UtcDaliPushButtonInterruptEventWhenNonVisible(void) // A down event is sent inside the button's boundary. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDownInside ); + event.AddPoint( GetPointDownInside() ); // flush the queue and render once application.SendNotification(); @@ -546,7 +571,7 @@ int UtcDaliPushButtonInterruptEventWhenNonVisible(void) // An up event is sent outside the button's boundary but inside the actor's one. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointUpOutside ); + event.AddPoint( GetPointUpOutside() ); // flush the queue and render once application.SendNotification(); @@ -573,7 +598,7 @@ int UtcDaliPushButtonInterruptEventWhenNonVisible(void) // A down event is sent inside the button's boundary. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDownInside ); + event.AddPoint( GetPointDownInside() ); // flush the queue and render once application.SendNotification(); @@ -591,7 +616,7 @@ int UtcDaliPushButtonInterruptEventWhenNonVisible(void) // A motion event is sent outside the button's boundary but inside the actor's one. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointMotionOut ); + event.AddPoint( GetPointMotionOut() ); // flush the queue and render once application.SendNotification(); @@ -617,7 +642,7 @@ int UtcDaliPushButtonInterruptEventWhenNonVisible(void) // A down event is sent inside the button's boundary. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDownInside ); + event.AddPoint( GetPointDownInside() ); // flush the queue and render once application.SendNotification(); @@ -636,7 +661,7 @@ int UtcDaliPushButtonInterruptEventWhenNonVisible(void) // An up event is sent inside the button's boundary. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointUpInside ); + event.AddPoint( GetPointUpInside() ); // flush the queue and render once application.SendNotification();