// 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 the text-changed signal. int utcDaliTextFieldTextChangedN(void) { ToolkitTestApplication application; tet_infoline(" utcDaliTextFieldTextChangedN"); TextField field = TextField::New(); DALI_TEST_CHECK( field ); Stage::GetCurrent().Add( field ); field.TextChangedSignal().Connect(&TestTextChangedCallback); gTextChangedCallBackCalled = false; field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "ABC" ); // Setting placeholder, not TEXT DALI_TEST_CHECK( !gTextChangedCallBackCalled ); END_TEST; }