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=d00dc75e826ed254cea23f4b683a26b8de943a77;hp=c615774282e4fc2da275fc94fa0bc9b2c242ec01;hb=2daa5af9afa208c6e58b5a69ff304b513777aa63;hpb=6ea2f17f49c9c694a24d951160a7389c844d7889 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index c615774..d00dc75 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -30,6 +30,7 @@ #include #include #include "toolkit-clipboard.h" +#include using namespace Dali; using namespace Toolkit; @@ -106,6 +107,7 @@ const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP = "enableGr const char* const PROPERTY_NAME_BACKGROUND = "textBackground"; const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale"; const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR = "grabHandleColor"; +const char* const PROPERTY_NAME_INPUT_FILTER = "inputFilter"; const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f ); const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color. @@ -125,6 +127,8 @@ static bool gAnchorClickedCallBackCalled; static bool gAnchorClickedCallBackNotCalled; static bool gTextChangedCallBackCalled; static bool gMaxCharactersCallBackCalled; +static bool gInputFilteredAcceptedCallbackCalled; +static bool gInputFilteredRejectedCallbackCalled; static bool gInputStyleChangedCallbackCalled; static Dali::Toolkit::TextField::InputStyle::Mask gInputStyleMask; @@ -234,6 +238,20 @@ static void TestMaxLengthReachedCallback( TextField control ) gMaxCharactersCallBackCalled = true; } +static void TestInputFilteredCallback(TextField control, Toolkit::InputFilter::Property::Type type) +{ + tet_infoline(" TestInputFilteredCallback"); + + if(type == Toolkit::InputFilter::Property::ACCEPTED) + { + gInputFilteredAcceptedCallbackCalled = true; + } + else if(type == Toolkit::InputFilter::Property::REJECTED) + { + gInputFilteredRejectedCallbackCalled = true; + } +} + static void TestInputStyleChangedCallback( TextField control, TextField::InputStyle::Mask mask ) { tet_infoline(" TestInputStyleChangedCallback"); @@ -526,6 +544,7 @@ int UtcDaliTextFieldGetPropertyP(void) DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP ); 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 ); END_TEST; } @@ -1000,6 +1019,21 @@ int UtcDaliTextFieldSetPropertyP(void) field.SetProperty( DevelTextField::Property::GRAB_HANDLE_COLOR, Color::GREEN ); DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::GRAB_HANDLE_COLOR ), Color::GREEN, TEST_LOCATION ); + // Check the input filter property + Property::Map inputFilterMapSet; + Property::Map inputFilterMapGet; + inputFilterMapSet[InputFilter::Property::ACCEPTED] = "[\\w]"; + inputFilterMapSet[InputFilter::Property::REJECTED] = "[\\d]"; + + field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilterMapSet); + + inputFilterMapGet = field.GetProperty(DevelTextField::Property::INPUT_FILTER); + DALI_TEST_EQUALS(inputFilterMapGet.Count(), inputFilterMapSet.Count(), TEST_LOCATION); + + // Clear + inputFilterMapSet.Clear(); + field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilterMapSet); + application.SendNotification(); application.Render(); @@ -1113,7 +1147,7 @@ int utcDaliTextFieldAnchorClicked02(void) application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE); // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 100); application.SendNotification(); application.Render(); @@ -1134,7 +1168,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 700); application.SendNotification(); field.SetKeyInputFocus(); @@ -1152,7 +1186,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 1300); application.SendNotification(); field.SetKeyInputFocus(); @@ -1170,7 +1204,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 1900); application.SendNotification(); field.SetKeyInputFocus(); @@ -1189,7 +1223,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 2500); application.SendNotification(); field.SetKeyInputFocus(); @@ -1208,7 +1242,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 3100); application.SendNotification(); application.Render(); @@ -1227,7 +1261,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 3700); application.SendNotification(); application.Render(); @@ -1246,7 +1280,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 4300); application.SendNotification(); application.Render(); @@ -1265,7 +1299,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 4900); application.SendNotification(); application.Render(); @@ -1284,7 +1318,7 @@ int utcDaliTextFieldAnchorClicked02(void) gAnchorClickedCallBackCalled = false; // Create a tap event to touch the text field. - TestGenerateTap(application, 30.0f, 25.0f); + TestGenerateTap(application, 30.0f, 25.0f, 5500); application.SendNotification(); application.Render(); @@ -1544,6 +1578,135 @@ int utcDaliTextFieldMaxCharactersReachedN(void) END_TEST; } +// Positive test for Input Filtered signal. +int utcDaliTextFieldInputFilteredP(void) +{ + ToolkitTestApplication application; + tet_infoline(" utcDaliTextFieldInputFilteredP"); + TextField field = TextField::New(); + DALI_TEST_CHECK(field); + + application.GetScene().Add(field); + + Property::Map inputFilter; + + // Only digit is accepted. + inputFilter[InputFilter::Property::ACCEPTED] = "[\\d]"; + + // Set input filter to TextField. + field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilter); + + field.SetKeyInputFocus(); + + // connect to the input filtered signal. + ConnectionTracker* testTracker = new ConnectionTracker(); + DevelTextField::InputFilteredSignal(field).Connect(&TestInputFilteredCallback); + bool inputFilteredSignal = false; + field.ConnectSignal(testTracker, "inputFiltered", CallbackFunctor(&inputFilteredSignal)); + + gInputFilteredAcceptedCallbackCalled = false; + + application.ProcessEvent(GenerateKey( "a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE )); + + DALI_TEST_CHECK(gInputFilteredAcceptedCallbackCalled); + DALI_TEST_CHECK(inputFilteredSignal); + + // Word is rejected. + inputFilter[InputFilter::Property::ACCEPTED] = ""; + inputFilter[InputFilter::Property::REJECTED] = "[\\w]"; + + // Set input filter to TextField. + field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilter); + + field.SetKeyInputFocus(); + + inputFilteredSignal = false; + gInputFilteredRejectedCallbackCalled = false; + + application.ProcessEvent(GenerateKey( "a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + + DALI_TEST_CHECK(gInputFilteredAcceptedCallbackCalled); + DALI_TEST_CHECK(inputFilteredSignal); + + END_TEST; +} + +// Negative test for Input Filtered signal. +int utcDaliTextFieldInputFilteredN(void) +{ + ToolkitTestApplication application; + tet_infoline(" utcDaliTextFieldInputFilteredP"); + TextField field = TextField::New(); + DALI_TEST_CHECK(field); + + application.GetScene().Add(field); + + Property::Map inputFilter; + + // Only word is accepted. + inputFilter[InputFilter::Property::ACCEPTED] = "[\\w]"; + + // Set input filter to TextField. + field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilter); + + field.SetKeyInputFocus(); + + // connect to the input filtered signal. + ConnectionTracker* testTracker = new ConnectionTracker(); + DevelTextField::InputFilteredSignal(field).Connect(&TestInputFilteredCallback); + bool inputFilteredSignal = false; + field.ConnectSignal(testTracker, "inputFiltered", CallbackFunctor(&inputFilteredSignal)); + + gInputFilteredAcceptedCallbackCalled = false; + + // Key a, d should not be filtered. + application.ProcessEvent(GenerateKey("a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + application.ProcessEvent(GenerateKey("a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::UP, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + + // Backspace, Delete should not be filtered. + application.ProcessEvent(GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + application.ProcessEvent(GenerateKey( "Delete", "", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + + // Render and notify + application.SendNotification(); + application.Render(); + + DALI_TEST_CHECK(!gInputFilteredAcceptedCallbackCalled); + DALI_TEST_CHECK(!inputFilteredSignal); + + // Digit is rejected. + inputFilter[InputFilter::Property::ACCEPTED] = ""; + inputFilter[InputFilter::Property::REJECTED] = "[\\d]"; + + field.SetProperty(DevelTextField::Property::INPUT_FILTER, inputFilter); + + field.SetKeyInputFocus(); + + inputFilteredSignal = false; + gInputFilteredRejectedCallbackCalled = false; + + // Key a, d should not be filtered. + application.ProcessEvent(GenerateKey("a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + application.ProcessEvent(GenerateKey("a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::UP, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + + // Backspace, Delete should not be filtered. + application.ProcessEvent(GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + application.ProcessEvent(GenerateKey( "Delete", "", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "Delete", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE)); + + // Render and notify + application.SendNotification(); + application.Render(); + + DALI_TEST_CHECK(!gInputFilteredAcceptedCallbackCalled); + DALI_TEST_CHECK(!inputFilteredSignal); + + END_TEST; +} + int utcDaliTextFieldInputStyleChanged01(void) { // The text-field emits signals when the input style changes. These changes of style are @@ -1931,7 +2094,7 @@ int utcDaliTextFieldInputStyleChanged02(void) DALI_TEST_CHECK( !inputStyleChangedSignal ); // Create a tap event to touch the text field. - TestGenerateTap( application, 63.0f, 25.0f, 300 ); + TestGenerateTap( application, 63.0f, 25.0f, 700 ); // Render and notify application.SendNotification(); @@ -3058,6 +3221,70 @@ int UtcDaliTextFieldSettingPlaceholder(void) END_TEST; } +int UtcDaliTextFieldPlaceholderCoverage(void) +{ + ToolkitTestApplication application; + tet_infoline("UtcDaliTextFieldPlaceholderCoverage"); + + // mPlaceholderFont is created only once, so create a new control for coverage. + TextField fieldForCoverage = TextField::New(); + DALI_TEST_CHECK(fieldForCoverage); + application.GetScene().Add(fieldForCoverage); + + // for SetPlaceholderFontFamily() coverage. + Property::Map fontFamilyMap; + fontFamilyMap[Text::PlaceHolder::Property::FONT_FAMILY] = "Arial"; + fieldForCoverage.SetProperty(TextField::Property::PLACEHOLDER, fontFamilyMap); + + // mPlaceholderFont is created only once, so create a new control for coverage. + fieldForCoverage = TextField::New(); + DALI_TEST_CHECK(fieldForCoverage); + application.GetScene().Add(fieldForCoverage); + + // for SetPlaceholderTextFontSize coverage. + Property::Map fontSizeMap; + fontSizeMap[Text::PlaceHolder::Property::PIXEL_SIZE] = 15.0f; + fieldForCoverage.SetProperty(TextField::Property::PLACEHOLDER, fontSizeMap); + + // mPlaceholderFont is created only once, so create a new control for coverage. + fieldForCoverage = TextField::New(); + DALI_TEST_CHECK(fieldForCoverage); + application.GetScene().Add(fieldForCoverage); + + // for SetPlaceholderTextFontWeight coverage. + Property::Map fontStyleWeightMap; + Property::Map fontStyleWeightPropertyMap; + fontStyleWeightPropertyMap.Insert("weight", "bold"); + fontStyleWeightMap[Text::PlaceHolder::Property::FONT_STYLE] = fontStyleWeightPropertyMap; + fieldForCoverage.SetProperty(TextField::Property::PLACEHOLDER, fontStyleWeightMap); + + // mPlaceholderFont is created only once, so create a new control for coverage. + fieldForCoverage = TextField::New(); + DALI_TEST_CHECK(fieldForCoverage); + application.GetScene().Add(fieldForCoverage); + + // for SetPlaceholderTextFontWidth coverage. + Property::Map fontStyleWidthMap; + Property::Map fontStyleWidthPropertyMap; + fontStyleWidthPropertyMap.Insert("width", "expanded"); + fontStyleWidthMap[Text::PlaceHolder::Property::FONT_STYLE] = fontStyleWidthPropertyMap; + fieldForCoverage.SetProperty(TextField::Property::PLACEHOLDER, fontStyleWidthMap); + + // mPlaceholderFont is created only once, so create a new control for coverage. + fieldForCoverage = TextField::New(); + DALI_TEST_CHECK(fieldForCoverage); + application.GetScene().Add(fieldForCoverage); + + // for SetPlaceholderTextFontSlant coverage. + Property::Map fontStyleSlantMap; + Property::Map fontStyleSlantPropertyMap; + fontStyleSlantPropertyMap.Insert("slant", "italic"); + fontStyleSlantMap[Text::PlaceHolder::Property::FONT_STYLE] = fontStyleSlantPropertyMap; + fieldForCoverage.SetProperty(TextField::Property::PLACEHOLDER, fontStyleSlantMap); + + END_TEST; +} + int UtcDaliTextFieldSetPaddingProperty(void) { ToolkitTestApplication application; @@ -3162,12 +3389,12 @@ int UtcDaliTextFieldMatchSystemLanguageDirectionProperty(void) application.SendNotification(); application.Render(); - // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'false'. - DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION ); + // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'true'. + DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION ); // Check the match system language direction property - field.SetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true ); - DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION ); + field.SetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false ); + DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION ); application.SendNotification(); application.Render(); @@ -3319,6 +3546,66 @@ int UtcDaliTextFieldSelectWholeText(void) END_TEST; } +int UtcDaliTextFieldSelectText(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextFieldSelectText "); + + TextField textField = TextField::New(); + + application.GetScene().Add( textField ); + + textField.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) ); + textField.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); + textField.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + application.SendNotification(); + application.Render(); + + DevelTextField::SelectText( textField, 0, 5 ); + + application.SendNotification(); + application.Render(); + + // Nothing is selected + std::string selectedText = textField.GetProperty( DevelTextField::Property::SELECTED_TEXT ).Get(); + DALI_TEST_EQUALS( "", selectedText, TEST_LOCATION ); + + textField.SetProperty( TextField::Property::TEXT, "Hello world" ); + + application.SendNotification(); + application.Render(); + + // Hello is selected + DevelTextField::SelectText( textField, 0, 5 ); + + application.SendNotification(); + application.Render(); + + selectedText = textField.GetProperty( DevelTextField::Property::SELECTED_TEXT ).Get(); + DALI_TEST_EQUALS( "Hello", selectedText, TEST_LOCATION ); + + DALI_TEST_EQUALS( textField.GetProperty( DevelTextField::Property::SELECTED_TEXT_START ).Get(), 0, TEST_LOCATION ); + DALI_TEST_EQUALS( textField.GetProperty( DevelTextField::Property::SELECTED_TEXT_END ).Get(), 5, TEST_LOCATION ); + + // world is selected + DevelTextField::SelectText( textField, 6, 11 ); + + application.SendNotification(); + application.Render(); + + selectedText = textField.GetProperty( DevelTextField::Property::SELECTED_TEXT ).Get(); + DALI_TEST_EQUALS( "world", selectedText, TEST_LOCATION ); + + DALI_TEST_EQUALS( textField.GetProperty( DevelTextField::Property::SELECTED_TEXT_START ).Get(), 6, TEST_LOCATION ); + DALI_TEST_EQUALS( textField.GetProperty( DevelTextField::Property::SELECTED_TEXT_END ).Get(), 11, TEST_LOCATION ); + + END_TEST; +} + int UtcDaliTextFieldSelectNone(void) { ToolkitTestApplication application; @@ -3512,6 +3799,7 @@ int UtcDaliTextFieldPrimaryCursorPosition(void) textField.SetProperty( DevelTextField::Property::PRIMARY_CURSOR_POSITION, 3); application.SendNotification(); application.Render(); + textField.SetKeyInputFocus(); application.ProcessEvent( GenerateKey( "D", "", "D", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "D", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); @@ -3628,4 +3916,64 @@ int UtcDaliTextFieldAtlasLimitationIsEnabledPerformanceCases(void) } END_TEST; +} + +int UtcDaliToolkitTextFieldEllipsisPositionProperty(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliToolkitTextFieldEllipsisPositionProperty "); + TextField textField = TextField::New(); + + tet_infoline(" UtcDaliToolkitTextFieldEllipsisPositionProperty - Default is END"); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextFieldEllipsisPositionProperty - Change to START"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::START); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::START ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextFieldEllipsisPositionProperty - Change to MIDDLE"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::MIDDLE); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::MIDDLE ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextFieldEllipsisPositionProperty - Change to END"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::END); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextFieldEllipsisPositionProperty - Change to START using integer"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, 1); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::START ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextFieldEllipsisPositionProperty - Change to MIDDLE using integer"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, 2); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::MIDDLE ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextFieldEllipsisPositionProperty - Change to END using integer"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, 0); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to START using string - uppercase"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, "START"); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::START ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to MIDDLE using string - uppercase"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, "MIDDLE"); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::MIDDLE ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to END using string - uppercase"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, "END"); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to START using string - lowercase"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, "start"); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::START ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to MIDDLE using string - lowercase"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, "middle"); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::MIDDLE ), TEST_LOCATION ); + + tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to END using string - lowercase"); + textField.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, "end"); + DALI_TEST_EQUALS( textField.GetProperty< int >( DevelTextField::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION ); + + END_TEST; } \ No newline at end of file