X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-Popup.cpp;h=1cd8ad6500c3c62ffe4e30377c0f63a7eb1ac176;hb=f871dce5373ce3d4f414963a68505eefc0d49cd2;hp=f9fd5135cb71f671a3d0ae0a61561a22cd24be7e;hpb=a073ebfd862b49692c8e6d7dff2b128e62a4f6df;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp index f9fd513..1cd8ad6 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -55,8 +55,22 @@ const int RENDER_FRAME_INTERVAL = 10; ///< Duration of const int RENDER_ANIMATION_TEST_DURATION_MS = 2000; ///< 2000ms to test animation. const int RENDER_ANIMATION_TEST_DURATION_FRAMES = RENDER_ANIMATION_TEST_DURATION_MS / RENDER_FRAME_INTERVAL; ///< equivalent frames. const Vector3 DEFAULT_BUTTON_SIZE(100.0f, 50.0f, 0.0f); -const Dali::TouchPoint pointDownOutside( 0, TouchPoint::Down, 10.0f, 10.0f ); -const Dali::TouchPoint pointUpOutside( 0, TouchPoint::Up, 10.0f, 10.0f ); + +Dali::Integration::Point GetPointDown() +{ + Dali::Integration::Point point; + point.SetState( PointState::DOWN ); + point.SetScreenPosition( Vector2( 10, 10 ) ); + return point; +} + +Dali::Integration::Point GetPointUp() +{ + Dali::Integration::Point point; + point.SetState( PointState::UP ); + point.SetScreenPosition( Vector2( 10, 10 ) ); + return point; +} /** * Counts how many descendants root Actor has, including @@ -627,14 +641,14 @@ int UtcDaliPopupOnTouchedOutsideSignal(void) Dali::Integration::TouchEvent event; event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDownOutside ); + event.AddPoint( GetPointDown() ); application.ProcessEvent( event ); application.SendNotification(); application.Render(); event = Dali::Integration::TouchEvent(); - event.AddPoint( pointUpOutside ); + event.AddPoint( GetPointUp() ); application.ProcessEvent( event ); application.SendNotification(); @@ -645,14 +659,14 @@ int UtcDaliPopupOnTouchedOutsideSignal(void) popup.SetProperty( Popup::Property::TOUCH_TRANSPARENT, true ); event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDownOutside ); + event.AddPoint( GetPointDown() ); application.ProcessEvent( event ); application.SendNotification(); application.Render(); event = Dali::Integration::TouchEvent(); - event.AddPoint( pointUpOutside ); + event.AddPoint( GetPointUp() ); application.ProcessEvent( event ); application.SendNotification(); @@ -1000,11 +1014,11 @@ int UtcDaliPopupPropertyBackgroundImage(void) Popup popup = Popup::New(); Stage::GetCurrent().Add( popup ); - // Check setting an invalid image. + // Check setting an image popup.SetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE, "invalid-image.png" ); std::string resultString; popup.GetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE ).Get( resultString ); - DALI_TEST_EQUALS( resultString, std::string(""), TEST_LOCATION ); + DALI_TEST_EQUALS( resultString, "invalid-image.png", TEST_LOCATION ); END_TEST; } @@ -1057,9 +1071,9 @@ int UtcDaliPopupPropertyCustomAnimation(void) Property::Map resultMap; DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::ENTRY_ANIMATION ).Get( resultMap ) ); - DALI_TEST_EQUALS( resultMap.Count(), 0, TEST_LOCATION ); + DALI_TEST_EQUALS( resultMap.Count(), 0u, TEST_LOCATION ); DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::EXIT_ANIMATION ).Get( resultMap ) ); - DALI_TEST_EQUALS( resultMap.Count(), 0, TEST_LOCATION ); + DALI_TEST_EQUALS( resultMap.Count(), 0u, TEST_LOCATION ); Stage::GetCurrent().Add( popup ); popup.SetDisplayState( Popup::SHOWN ); @@ -1127,18 +1141,16 @@ int UtcDaliPopupPropertyTouchTransparent(void) gPushButtonClicked = false; Dali::Integration::TouchEvent event; - const Dali::TouchPoint pointDown( 0, TouchPoint::Down, 10.0f, 10.0f ); - const Dali::TouchPoint pointUp( 0, TouchPoint::Up, 10.0f, 10.0f ); // Perform a click, the popup should block the click from hitting the button. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDown ); + event.AddPoint( GetPointDown() ); application.ProcessEvent( event ); application.SendNotification(); application.Render(); event = Dali::Integration::TouchEvent(); - event.AddPoint( pointUp ); + event.AddPoint( GetPointUp() ); application.ProcessEvent( event ); application.SendNotification(); application.Render(); @@ -1153,13 +1165,13 @@ int UtcDaliPopupPropertyTouchTransparent(void) // Perform a click, the popup should allow the click to travel through to the button. event = Dali::Integration::TouchEvent(); - event.AddPoint( pointDown ); + event.AddPoint( GetPointDown() ); application.ProcessEvent( event ); application.SendNotification(); application.Render(); event = Dali::Integration::TouchEvent(); - event.AddPoint( pointUp ); + event.AddPoint( GetPointUp() ); application.ProcessEvent( event ); application.SendNotification(); application.Render();