X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fdali-test-suite%2Ftext-input%2Futc-Dali-TextInput.cpp;h=188df8f05c3b294756bdcbf5d1b9d2d5c131fda1;hp=e8f0b5122ba7286ffe69e405aaa601a413b4e5ba;hb=b3d90507ee795f72510693a54121b3a54b1c046c;hpb=39f1334fc8f77518d3be6d68579e961719e69efb diff --git a/automated-tests/dali-test-suite/text-input/utc-Dali-TextInput.cpp b/automated-tests/dali-test-suite/text-input/utc-Dali-TextInput.cpp index e8f0b51..188df8f 100644 --- a/automated-tests/dali-test-suite/text-input/utc-Dali-TextInput.cpp +++ b/automated-tests/dali-test-suite/text-input/utc-Dali-TextInput.cpp @@ -187,8 +187,6 @@ static void UtcDaliTextInputSetMaxCharacterLength() const int maxChars = 4; const char* testChar = "v"; - Dali::Integration::Core& core = application.GetCore(); - TextInput textInput = TextInput::New(); // create empty TextInput Stage::GetCurrent().Add(textInput); @@ -202,19 +200,19 @@ static void UtcDaliTextInputSetMaxCharacterLength() // Send max number of characters for (int i=0; i < maxChars; i++) { - core.SendEvent(event); + application.ProcessEvent(event); testString.append(testChar); } DALI_TEST_EQUALS(testString,textInput.GetText(), TEST_LOCATION); // Get text which should be empty - core.SendEvent(event); // try to append additional character + application.ProcessEvent(event); // try to append additional character DALI_TEST_EQUALS(testString,textInput.GetText(), TEST_LOCATION); // Get text which should be empty textInput.SetMaxCharacterLength(maxChars+1); // increment max characters by 1 - core.SendEvent(event); // append additional character + application.ProcessEvent(event); // append additional character testString.append(testChar); DALI_TEST_EQUALS(testString,textInput.GetText(), TEST_LOCATION); // Get text which should be empty @@ -242,8 +240,6 @@ static void UtcDaliTextInputAddChars() tet_infoline("Testing Adding characters"); - Dali::Integration::Core& core = application.GetCore(); - TextInput textInput = TextInput::New(); // create empty TextInput Stage::GetCurrent().Add(textInput); @@ -251,12 +247,12 @@ static void UtcDaliTextInputAddChars() textInput.SetKeyInputFocus(); Integration::KeyEvent event("a", "a", 0, 0, 0, Integration::KeyEvent::Down); - core.SendEvent(event); + application.ProcessEvent(event); DALI_TEST_EQUALS("a",textInput.GetText(), TEST_LOCATION); // Get text which should be "a" Integration::KeyEvent event2("v", "v", 0, 0, 0, Integration::KeyEvent::Down); - core.SendEvent(event2); + application.ProcessEvent(event2); DALI_TEST_EQUALS("av",textInput.GetText(), TEST_LOCATION); // Get text which should be "av" } @@ -267,8 +263,6 @@ static void UtcDaliTextInputRemoveChars() tet_infoline("Testing Removal of end characters"); - Dali::Integration::Core& core = application.GetCore(); - TextInput textInput = TextInput::New(); // create empty TextInput Stage::GetCurrent().Add(textInput); @@ -276,21 +270,21 @@ static void UtcDaliTextInputRemoveChars() textInput.SetKeyInputFocus(); Integration::KeyEvent event("a", "a", 0, 0, 0, Integration::KeyEvent::Down); - core.SendEvent(event); + application.ProcessEvent(event); DALI_TEST_EQUALS("a",textInput.GetText(), TEST_LOCATION); // Get text which should be "a" Integration::KeyEvent event2("BackSpace", "", 0, 0, 0, Integration::KeyEvent::Down); - core.SendEvent(event2); + application.ProcessEvent(event2); DALI_TEST_EQUALS("",textInput.GetText(), TEST_LOCATION); // Get text which should be "" - core.SendEvent(event); - core.SendEvent(event); + application.ProcessEvent(event); + application.ProcessEvent(event); DALI_TEST_EQUALS("aa",textInput.GetText(), TEST_LOCATION); // Get text which should be "aa" - core.SendEvent(event2); + application.ProcessEvent(event2); DALI_TEST_EQUALS("a",textInput.GetText(), TEST_LOCATION); // Get text which should be "a" } @@ -386,8 +380,6 @@ static void UtcDaliTextInputExceedMaxCharacters() { ToolkitTestApplication application; - Dali::Integration::Core& core = application.GetCore(); - tet_infoline("Testing Max characters is obeyed when inputting key events "); TextInput textInput = TextInput::New(); // create empty TextInput @@ -403,13 +395,13 @@ static void UtcDaliTextInputExceedMaxCharacters() Integration::KeyEvent eventA("a", "a", 0, 0, 0, Integration::KeyEvent::Down ); Integration::KeyEvent eventB("b", "b", 0, 0, 0, Integration::KeyEvent::Down ); - core.SendEvent(eventA); - core.SendEvent(eventB); - core.SendEvent(eventA); - core.SendEvent(eventB); + application.ProcessEvent(eventA); + application.ProcessEvent(eventB); + application.ProcessEvent(eventA); + application.ProcessEvent(eventB); - core.SendEvent(eventA); - core.SendEvent(eventB); + application.ProcessEvent(eventA); + application.ProcessEvent(eventB); tet_printf( "Get text result : %s\n", textInput.GetText().c_str());