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=3e369f6bdc846e8af3a786cedf2203c1947986e7;hp=07f1cac4ea65b5e9dd2621c9964a92bd6130aaff;hb=81d8e007ed1aed6e36e4cf44e456d91cf8024004;hpb=a455f2fbd87ecda74aa084741cc8666db0cf7e43 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 07f1cac..3e369f6 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,7 @@ const float SCROLL_SPEED = 300.f; const unsigned int DEFAULT_FONT_SIZE = 1152u; const std::string DEFAULT_FONT_DIR( "/resources/fonts" ); +const int KEY_RETURN_CODE = 36; const int KEY_A_CODE = 38; const int KEY_D_CODE = 40; @@ -1155,6 +1157,11 @@ int utcDaliTextFieldMaxCharactersReachedN(void) DALI_TEST_CHECK( !gMaxCharactersCallBackCalled ); DALI_TEST_CHECK( !maxLengthReachedSignal ); + application.ProcessEvent( GenerateKey( "Return", "\r", KEY_RETURN_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + + DALI_TEST_CHECK( !gMaxCharactersCallBackCalled ); + DALI_TEST_CHECK( !maxLengthReachedSignal ); + END_TEST; } @@ -1631,6 +1638,12 @@ int utcDaliTextFieldEvent01(void) application.SendNotification(); application.Render(); + // Pressing delete key should be fine even if there is no text in TextField. + application.ProcessEvent( GenerateKey( "Delete", "Delete", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + // Render and notify + application.SendNotification(); + application.Render(); + // Now the text field has the focus, so it can handle the key events. application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.ProcessEvent( GenerateKey( "a", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );