// Positive test for the text-changed signal. int utcDaliTextFieldTextChangedP(void) { ToolkitTestApplication application; tet_infoline(" utcDaliTextFieldTextChangedP"); TextField field = TextField::New(); DALI_TEST_CHECK( field ); Stage::GetCurrent().Add( field ); field.TextChangedSignal().Connect(&TestTextChangedCallback); gTextChangedCallBackCalled = false; field.SetProperty( TextField::Property::TEXT, "ABC" ); DALI_TEST_CHECK( gTextChangedCallBackCalled ); application.SendNotification(); field.SetKeyInputFocus(); gTextChangedCallBackCalled = false; application.ProcessEvent( GenerateKey( "D", "D", 0, 0, 0, Integration::KeyEvent::Down ) ); DALI_TEST_CHECK( gTextChangedCallBackCalled ); END_TEST; }
// Negative test for Max Characters reached signal. int utcDaliTextFieldMaxCharactersReachedN(void) { ToolkitTestApplication application; tet_infoline(" utcDaliTextFieldMaxCharactersReachedN"); TextField field = TextField::New(); DALI_TEST_CHECK( field ); Stage::GetCurrent().Add( field ); const int maxNumberOfCharacters = 3; field.SetProperty( TextField::Property::MAX_LENGTH, maxNumberOfCharacters ); field.SetKeyInputFocus(); gMaxCharactersCallBackCalled = false; field.MaxLengthReachedSignal().Connect(&TestMaxLengthReachedCallback); application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); application.ProcessEvent( GenerateKey( "a", "a", 0, 0, 0, Integration::KeyEvent::Down ) ); DALI_TEST_CHECK( !gMaxCharactersCallBackCalled ); END_TEST; }