Send the empty string to IME when PlaceholderText shows
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-Text-Controller.cpp
index c0a7076..02f2e66 100644 (file)
@@ -184,9 +184,16 @@ int UtcDaliTextControllerImfEvent(void)
   // Enables the text input.
   controller->EnableTextInput( decorator );
 
   // Enables the text input.
   controller->EnableTextInput( decorator );
 
+  // Set the placeholder text.
+  controller->SetPlaceholderText( Controller::PLACEHOLDER_TYPE_INACTIVE, "Hello Dali" );
+
   // Creates an ImfManager.
   ImfManager imfManager = ImfManager::Get();
 
   // Creates an ImfManager.
   ImfManager imfManager = ImfManager::Get();
 
+  // For coverage.
+  imfEvent = ImfManager::ImfEventData( ImfManager::GETSURROUNDING, "", 0, 0 );
+  controller->OnImfEvent( imfManager, imfEvent );
+
   // Send VOID event.
   imfEvent = ImfManager::ImfEventData( ImfManager::VOID, "", 0, 0 );
   controller->OnImfEvent( imfManager, imfEvent );
   // Send VOID event.
   imfEvent = ImfManager::ImfEventData( ImfManager::VOID, "", 0, 0 );
   controller->OnImfEvent( imfManager, imfEvent );
@@ -194,6 +201,18 @@ int UtcDaliTextControllerImfEvent(void)
   controller->GetText( text );
   DALI_TEST_CHECK( text.empty() );
 
   controller->GetText( text );
   DALI_TEST_CHECK( text.empty() );
 
+  imfEvent = ImfManager::ImfEventData( ImfManager::COMMIT, "Hello ", 0, 6 );
+  controller->OnImfEvent( imfManager, imfEvent );
+  controller->GetNaturalSize();
+
+  // Check 'Delete All' key which means the input panel send a big range
+  imfEvent = ImfManager::ImfEventData( ImfManager::DELETESURROUNDING, "", -100, 100 );
+  controller->OnImfEvent( imfManager, imfEvent );
+  controller->GetNaturalSize();
+
+  controller->GetText( text );
+  DALI_TEST_EQUALS( "", text, TEST_LOCATION );
+
   // Send COMMIT event.
   imfEvent = ImfManager::ImfEventData( ImfManager::COMMIT, "Hello ", 0, 6 );
   controller->OnImfEvent( imfManager, imfEvent );
   // Send COMMIT event.
   imfEvent = ImfManager::ImfEventData( ImfManager::COMMIT, "Hello ", 0, 6 );
   controller->OnImfEvent( imfManager, imfEvent );