Add post processor
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TextSelectionPopup.cpp
index dc7fcc7..11b9f46 100644 (file)
@@ -153,17 +153,17 @@ int UtcDaliToolkitTextSelectionToolBarP(void)
   toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size( 100.0f, 60.0f) );
 
   Toolkit::PushButton option = Toolkit::PushButton::New();
-  option.SetName( "test-option" );
+  option.SetProperty( Dali::Actor::Property::NAME, "test-option" );
   option.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   toolbar.AddOption( option );
 
   Toolkit::Control divider = Toolkit::Control::New();
-  divider.SetSize( 2.0f, 0.0f );
+  divider.SetProperty( Actor::Property::SIZE, Vector2( 2.0f, 0.0f ) );
   divider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
   toolbar.AddDivider( divider );
 
   Toolkit::PushButton option2 = Toolkit::PushButton::New();
-  option2.SetName( "test-option-2" );
+  option2.SetProperty( Dali::Actor::Property::NAME, "test-option-2" );
   option2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   toolbar.AddOption( option2 );
 
@@ -184,7 +184,7 @@ int UtcDaliToolkitTextSelectionToolBarScrollBarP(void)
   toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size( 100.0f, 60.0f) );
 
   Toolkit::PushButton option = Toolkit::PushButton::New();
-  option.SetName( "test-option" );
+  option.SetProperty( Dali::Actor::Property::NAME, "test-option" );
   option.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   toolbar.AddOption( option );
 
@@ -205,7 +205,7 @@ int UtcDaliToolkitTextSelectionToolBarScrollView(void)
 
   TextSelectionToolbar toolbar = TextSelectionToolbar::New();
   DALI_TEST_CHECK( toolbar );
-  Stage::GetCurrent().Add( toolbar );
+  application.GetScene().Add( toolbar );
 
   Property::Map map;
   map["overshootEffectColor"] = Color::RED;
@@ -230,3 +230,48 @@ int UtcDaliToolkitTextSelectionToolBarScrollView(void)
   END_TEST;
 }
 
+int UtcDaliToolkitTextSelectionPopupIconProperties(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup popup = TextSelectionPopup::New(nullptr);
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE, "POPUP_CLIPBOARD_BUTTON_ICON_IMAGE");
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE, "POPUP_CUT_BUTTON_ICON_IMAGE");
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE, "POPUP_COPY_BUTTON_ICON_IMAGE");
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE, "POPUP_PASTE_BUTTON_ICON_IMAGE");
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE, "POPUP_SELECT_BUTTON_ICON_IMAGE");
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE, "POPUP_SELECT_ALL_BUTTON_ICON_IMAGE");
+
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_CLIPBOARD_BUTTON_ICON_IMAGE", TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_CUT_BUTTON_ICON_IMAGE", TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_COPY_BUTTON_ICON_IMAGE", TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_PASTE_BUTTON_ICON_IMAGE", TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_SELECT_BUTTON_ICON_IMAGE", TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_SELECT_ALL_BUTTON_ICON_IMAGE", TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitTextSelectionPopupSizeProperties(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup popup = TextSelectionPopup::New(nullptr);
+
+  const Vector2 popupMaxSize(200.0f, 300.0f);
+  const Vector2 optionMaxSize(50.0f, 100.0f);
+  const Vector2 optionMinSize(10.0f, 10.0f);
+  const Vector2 optionDividerSize(5.0f, 5.0f);
+  const Vector4 optionDividerPadding(20.0f, 20.0f, 10.0f, 10.0f);
+  popup.SetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE, popupMaxSize);
+  popup.SetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE, optionMaxSize);
+  popup.SetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE, optionMinSize);
+  popup.SetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE, optionDividerSize);
+  popup.SetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_PADDING, optionDividerPadding);
+
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE).Get<Vector2>(), popupMaxSize, TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE).Get<Vector2>(), optionMaxSize, TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE).Get<Vector2>(), optionMinSize, TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE).Get<Vector2>(), optionDividerSize, TEST_LOCATION);
+  DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_PADDING).Get<Vector4>(), optionDividerPadding, TEST_LOCATION);
+
+  END_TEST;
+}