From: minho.sun Date: Tue, 25 Jul 2017 13:23:24 +0000 (+0900) Subject: Ensure text-controller returns false when it doesn't use key. X-Git-Tag: dali_1.2.50~3^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=5837401cd740351058bddc1d8d1a85ec35b076d5 Ensure text-controller returns false when it doesn't use key. Ensure text-controller returns false when it doesn't use key. Plus, add tct cases for coverage. Change-Id: I328af4c216e22cf7a3aff2d5ce2dea3780168f3a Signed-off-by: minho.sun --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index a052525..3fd4bd6 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -1930,7 +1930,22 @@ int utcDaliTextEditorEvent06(void) DALI_TEST_EQUALS( "Hello\nworld\nHello world", editor.GetProperty( TextEditor::Property::TEXT ), TEST_LOCATION ); + // For coverage + application.ProcessEvent( GenerateKey( "", "", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) ); + application.SendNotification(); + application.Render(); + + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_SHIFT_LEFT, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) ); + application.SendNotification(); + application.Render(); + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_UP, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) ); + application.SendNotification(); + application.Render(); + + application.ProcessEvent( GenerateKey( "", "", DALI_KEY_VOLUME_DOWN, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE ) ); + application.SendNotification(); + application.Render(); END_TEST; } diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index feb620b..64e6a55 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -2219,6 +2219,7 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) { // In some platforms arrive key events with no key code. // Do nothing. + return false; } else if( Dali::DALI_KEY_ESCAPE == keyCode ) { @@ -2288,11 +2289,13 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) // and a character is typed after the type of a upper case latin character. // Do nothing. + return false; } else if( ( Dali::DALI_KEY_VOLUME_UP == keyCode ) || ( Dali::DALI_KEY_VOLUME_DOWN == keyCode ) ) { // This branch avoids calling the InsertText() method of the 'else' branch which can delete selected text. // Do nothing. + return false; } else {