Ensure Text Controls do an up-call on-style-change & trigger a relayout
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-styling / utc-Dali-StyleManager.cpp
index dc95a8e..20de8e8 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -642,8 +642,11 @@ int UtcDaliStyleManagerStyleChangedSignalFontFamily(void)
   Toolkit::TextLabel label = Toolkit::TextLabel::New(labelStr);
   Stage::GetCurrent().Add( label );
 
-  Toolkit::TextLabel label2 = Toolkit::TextLabel::New(labelStr);
-  Stage::GetCurrent().Add( label2 );
+  Toolkit::TextField field = Toolkit::TextField::New();
+  Stage::GetCurrent().Add( field );
+
+  Toolkit::TextEditor editor = Toolkit::TextEditor::New();
+  Stage::GetCurrent().Add( editor );
 
   StyleChangedSignalChecker styleChangedSignalHandler;
   Dali::StyleMonitor styleMonitor = Dali::StyleMonitor::Get();
@@ -666,6 +669,18 @@ int UtcDaliStyleManagerStyleChangedSignalFontFamily(void)
 
   DALI_TEST_EQUALS( familyStr, "Times New Roman", TEST_LOCATION);
 
+  // Check that the field's font style has been altered
+  family = field.GetProperty(TextField::Property::FONT_FAMILY);
+  family.Get( familyStr );
+
+  DALI_TEST_EQUALS( familyStr, "Times New Roman", TEST_LOCATION);
+
+  // Check that the editor's font style has been altered
+  family = editor.GetProperty(TextEditor::Property::FONT_FAMILY);
+  family.Get( familyStr );
+
+  DALI_TEST_EQUALS( familyStr, "Times New Roman", TEST_LOCATION);
+
   END_TEST;
 }