Fix behaviour when PreeditStyle is REVERSE
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-TextField-internal.cpp
index 1fbc13e..65de962 100755 (executable)
@@ -346,4 +346,39 @@ int UtcDaliTextFieldTextWithSpan(void)
   DALI_TEST_EQUALS( colorIndicesBuffer2[7], 0u, TEST_LOCATION);
 
   END_TEST;
+}
+
+int UtcDaliTextFieldControlBackgroundColor(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliTextFieldControlBackgroundColor\n");
+
+  TextField field = TextField::New();
+  DALI_TEST_CHECK(field);
+
+  Vector4 backgroundColor;
+
+  field.SetProperty(TextField::Property::TEXT, "Background Color");
+  application.GetScene().Add(field);
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Internal::TextField& fieldImpl = GetImpl(field);
+  ControllerPtr controller = fieldImpl.getController();
+  Controller::Impl& controllerImpl = Controller::Impl::GetImplementation(*controller.Get());
+
+  // Default color is transparent
+  controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
+  DALI_TEST_EQUALS(backgroundColor, Color::TRANSPARENT, TEST_LOCATION);
+
+  // Set background color to red
+  field.SetBackgroundColor(Color::RED);
+  application.SendNotification();
+  application.Render();
+
+  // Should be red
+  controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
+  DALI_TEST_EQUALS(backgroundColor, Color::RED, TEST_LOCATION);
+
+  END_TEST;
 }
\ No newline at end of file