From: Adeel Kazmi Date: Thu, 14 Jul 2016 07:07:46 +0000 (-0700) Subject: Merge changes I555b7cf0,I1be28edf,I605de844,I87caee64 into devel/master X-Git-Tag: dali_1.1.43~5 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=1ce7db19e4f67641a707c6a00668ac5395bcd562;hp=0eed80c81c4854bdc0ba491650ec12dc03c90689 Merge changes I555b7cf0,I1be28edf,I605de844,I87caee64 into devel/master * changes: (Automated Tests) Increase coverage of ScrollBar (Automated Tests) Increase coverage of Buttons (Automated Tests) Increase coverage of Builder (Automated Tests) Increase coverage of ItemView --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index d10e397..d3908ea 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -236,6 +237,19 @@ Integration::TapGestureEvent GenerateTap( return tap; } + +Integration::LongPressGestureEvent GenerateLongPress( + Gesture::State state, + unsigned int numberOfTouches, + Vector2 point) +{ + Integration::LongPressGestureEvent longPress( state ); + + longPress.numberOfTouches = numberOfTouches; + longPress.point = point; + return longPress; +} + // Generate a KeyEvent to send to Core. Integration::KeyEvent GenerateKey( const std::string& keyName, const std::string& keyString, @@ -1048,7 +1062,7 @@ int utcDaliTextFieldEvent05(void) ToolkitTestApplication application; tet_infoline(" utcDaliTextFieldEvent05"); - // Checks if the highlight actor is created. + // Checks dragging of cursor/grab handle TextField field = TextField::New(); DALI_TEST_CHECK( field ); @@ -1114,3 +1128,133 @@ int utcDaliTextFieldEvent05(void) Actor offscreenRoot = field.GetChildAt( 1u ); END_TEST; } + +int utcDaliTextFieldEvent06(void) +{ + ToolkitTestApplication application; + tet_infoline(" utcDaliTextFieldEvent06"); + + // Checks Longpress when in edit mode + + TextField field = TextField::New(); + DALI_TEST_CHECK( field ); + Stage::GetCurrent().Add( field ); + LoadMarkerImages(application, field); + // Render and notify + application.SendNotification(); + application.Render(); + + field.SetProperty( TextField::Property::TEXT, "Thisisalongtextforthesizeofthetextfield." ); + field.SetProperty( TextField::Property::POINT_SIZE, 10.f ); + field.SetSize( 300.f, 50.f ); + field.SetParentOrigin( ParentOrigin::TOP_LEFT ); + field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + // Render and notify + application.SendNotification(); + application.Render(); + + // Create a tap event to touch the text field. + application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); + // Render and notify + application.SendNotification(); + application.Render(); + + + // Tap first to get the focus. + application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) ); + application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + // Long Press + application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2( 1.f, 25.0f ) ) ); + application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, Vector2( 1.f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + END_TEST; +} + +int utcDaliTextFieldEvent07(void) +{ + ToolkitTestApplication application; + tet_infoline(" utcDaliTextFieldEvent06"); + + // Checks Longpress to start edit mode + + TextField field = TextField::New(); + DALI_TEST_CHECK( field ); + Stage::GetCurrent().Add( field ); + LoadMarkerImages(application, field); + // Render and notify + application.SendNotification(); + application.Render(); + + field.SetProperty( TextField::Property::TEXT, "Thisisalongtextforthesizeofthetextfield." ); + field.SetProperty( TextField::Property::POINT_SIZE, 10.f ); + field.SetSize( 300.f, 50.f ); + field.SetParentOrigin( ParentOrigin::TOP_LEFT ); + field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + // Render and notify + application.SendNotification(); + application.Render(); + + // Long Press + application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2( 1.f, 25.0f ) ) ); + application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, Vector2( 1.f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + END_TEST; +} + +int utcDaliTextFieldEvent08(void) +{ + ToolkitTestApplication application; + tet_infoline(" utcDaliTextFieldEvent06"); + + // Checks Longpress when only place holder text + + TextField field = TextField::New(); + DALI_TEST_CHECK( field ); + Stage::GetCurrent().Add( field ); + LoadMarkerImages(application, field); + // Render and notify + application.SendNotification(); + application.Render(); + + field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "Setting Placeholder Text" ); + field.SetProperty( TextField::Property::POINT_SIZE, 10.f ); + field.SetSize( 300.f, 50.f ); + field.SetParentOrigin( ParentOrigin::TOP_LEFT ); + field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + // Render and notify + application.SendNotification(); + application.Render(); + + // Long Press + application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2( 1.f, 25.0f ) ) ); + application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, Vector2( 1.f, 25.0f ) ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + END_TEST; +}