X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-TextField-internal.cpp;h=37d54e1d7aaaa626cd9e9cb6de5a9011b73532d5;hp=a098f73b551650b441d39ad60a56014139aa909d;hb=7b3206a6cd1d02affb3e14e757feb9b4904a4bb5;hpb=26a3b93400d9b9de81db36cbe4cea39f51940d10 diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp index a098f73..37d54e1 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp @@ -112,3 +112,43 @@ int UtcDaliTextFieldMultipleBackgroundText(void) END_TEST; } + +int UtcDaliTextFieldSelectText(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliTextFieldSelectText" ); + + // Create a text field + TextField textField = TextField::New(); + textField.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 60.f ) ); + textField.SetProperty( TextField::Property::TEXT, "Hello World" ); + + // Add the text field to the stage + application.GetScene().Add( textField ); + + application.SendNotification(); + application.Render(); + + Toolkit::Internal::TextField& textFieldImpl = GetImpl( textField ); + + application.SendNotification(); + application.Render(); + + // Highlight the whole text + textFieldImpl.SelectWholeText(); + + application.SendNotification(); + application.Render(); + + DALI_TEST_CHECK( textFieldImpl.GetSelectedText() == "Hello World" ); + + // Select None + textFieldImpl.SelectNone(); + + application.SendNotification(); + application.Render(); + + DALI_TEST_CHECK( textFieldImpl.GetSelectedText() == "" ); + + END_TEST; +}