X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-TextField.cpp;h=b4e4c9321af66835642d77098d6d039ad2c9288b;hp=d1a04e901add769a556fb9d28673fa66ba14b019;hb=fb87251cfeff34418a36798700b81786e522018a;hpb=478e477e07fde916953748d2cd4befc0326bfc34 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index d1a04e9..b4e4c93 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -95,6 +95,8 @@ const char* const PROPERTY_NAME_EMBOSS = "emboss"; const char* const PROPERTY_NAME_INPUT_EMBOSS = "inputEmboss"; const char* const PROPERTY_NAME_OUTLINE = "outline"; const char* const PROPERTY_NAME_INPUT_OUTLINE = "inputOutline"; +const char* const PROPERTY_NAME_STRIKETHROUGH = "strikethrough"; +const char* const PROPERTY_NAME_INPUT_STRIKETHROUGH = "inputStrikethrough"; const char* const PROPERTY_NAME_HIDDEN_INPUT_SETTINGS = "hiddenInputSettings"; const char* const PROPERTY_NAME_PIXEL_SIZE = "pixelSize"; @@ -577,6 +579,8 @@ int UtcDaliTextFieldGetPropertyP(void) DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_BACKGROUND ) == DevelTextField::Property::BACKGROUND ); DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_GRAB_HANDLE_COLOR ) == DevelTextField::Property::GRAB_HANDLE_COLOR ); DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_INPUT_FILTER ) == DevelTextField::Property::INPUT_FILTER ); + DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextField::Property::STRIKETHROUGH ); + DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_INPUT_STRIKETHROUGH ) == DevelTextField::Property::INPUT_STRIKETHROUGH ); END_TEST; } @@ -848,6 +852,24 @@ int UtcDaliTextFieldSetPropertyP(void) DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION ); DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION ); + Property::Map strikethroughMapSet; + Property::Map strikethroughMapGet; + + strikethroughMapSet.Insert( "enable", true ); + strikethroughMapSet.Insert( "color", Color::RED ); + strikethroughMapSet.Insert( "height", 2.0f ); + + // Check the strikethrough property + field.SetProperty( DevelTextField::Property::STRIKETHROUGH, strikethroughMapSet ); + + strikethroughMapGet = field.GetProperty( DevelTextField::Property::STRIKETHROUGH ); + DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION ); + DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION ); + + // Check the input strikethrough property + field.SetProperty( DevelTextField::Property::INPUT_STRIKETHROUGH, "Strikethrough input properties" ); + DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::INPUT_STRIKETHROUGH ), std::string("Strikethrough input properties"), TEST_LOCATION ); + Property::Map underlineMapSet; Property::Map underlineMapGet; @@ -2114,6 +2136,7 @@ int utcDaliTextFieldInputStyleChanged02(void) field.SetProperty( TextField::Property::INPUT_SHADOW, "shadow" ); field.SetProperty( TextField::Property::INPUT_EMBOSS, "emboss" ); field.SetProperty( TextField::Property::INPUT_OUTLINE, "outline" ); + field.SetProperty( DevelTextField::Property::INPUT_STRIKETHROUGH, "strikethrough" ); // Render and notify application.SendNotification(); @@ -4834,4 +4857,72 @@ int utcDaliTextFieldSelectionChangedSignal(void) DALI_TEST_EQUALS(oldSelectionEnd, 23, TEST_LOCATION); END_TEST; -} \ No newline at end of file +} + +int UtcDaliToolkitTextFieldStrikethroughGeneration(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliToolkitTextFieldStrikethroughGeneration"); + + TextField textField = TextField::New(); + textField.SetProperty( TextField::Property::TEXT, "Test" ); + textField.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 100.f ) ); + textField.SetProperty( TextField::Property::POINT_SIZE, 10) ; + textField.SetProperty( TextField::Property::FONT_FAMILY, "DejaVu Sans"); + + application.GetScene().Add( textField ); + application.SendNotification(); + application.Render(); + + Property::Map strikethroughMapSet; + Property::Map strikethroughMapGet; + + strikethroughMapSet.Insert( "enable", true ); + strikethroughMapSet.Insert( "color", Color::RED ); + strikethroughMapSet.Insert( "height", 2.0f ); + + // Check the strikethrough property + textField.SetProperty( DevelTextField::Property::STRIKETHROUGH, strikethroughMapSet ); + strikethroughMapGet = textField.GetProperty( DevelTextField::Property::STRIKETHROUGH ); + textField.SetProperty( TextField::Property::TEXT, "Test1" ); + DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION ); + DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION ); + + // Render and notify + application.SendNotification(); + application.Render(); + + strikethroughMapSet.Clear(); + strikethroughMapGet.Clear(); + + END_TEST; +} + +int UtcDaliToolkitTextFieldInputStrikethroughGeneration(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliToolkitTextFieldInputStrikethroughGeneration"); + + TextField textField = TextField::New(); + textField.SetProperty( TextField::Property::TEXT, "Test" ); + textField.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 100.f ) ); + textField.SetProperty( TextField::Property::POINT_SIZE, 10) ; + textField.SetProperty( TextField::Property::FONT_FAMILY, "DejaVu Sans"); + + application.GetScene().Add( textField ); + application.SendNotification(); + application.Render(); + + std::string strikethroughSettings1( "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"2\"}" ); + + // Check the strikethrough property + textField.SetProperty( DevelTextField::Property::INPUT_STRIKETHROUGH, strikethroughSettings1 ); + textField.SetProperty( TextField::Property::TEXT, "Test1" ); + DALI_TEST_EQUALS( textField.GetProperty( DevelTextField::Property::INPUT_STRIKETHROUGH ), strikethroughSettings1, TEST_LOCATION ); + + // Render and notify + application.SendNotification(); + application.Render(); + + END_TEST; +}