Adding a TextSelectionToolbar Utc test 12/79212/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 8 Jul 2016 18:11:24 +0000 (19:11 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 8 Jul 2016 18:11:24 +0000 (19:11 +0100)
Change-Id: Iac419410622c55825ced746c189805e70855a157

automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp

index f6f973062bbc11d445d6fa0d513279a42ae13b09..2cee1b52f3fc319099dd7195d93e3d7ed8dbc168 100644 (file)
@@ -20,6 +20,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -105,3 +106,37 @@ int UtcDaliToolkitTextSelectionPopupDownCastP(void)
 
   END_TEST;
 }
+
+// TextSelectionToolBar is used TextSelectionPopup, below tests it individually
+
+int UtcDaliToolkitTextSelectionToolBarP(void)
+{
+
+  // Creates Toolbar, adds 2 options and a divider then resizes divider
+  ToolkitTestApplication application;
+
+  TextSelectionToolbar toolbar = TextSelectionToolbar::New();
+
+  toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size( 100.0f, 60.0f) );
+
+  Toolkit::PushButton option = Toolkit::PushButton::New();
+  option.SetName( "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.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
+  toolbar.AddDivider( divider );
+
+  Toolkit::PushButton option2 = Toolkit::PushButton::New();
+  option2.SetName( "test-option-2" );
+  option2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+  toolbar.AddOption( option2 );
+
+  Size newSize =  Size(3.0f, 0.0f);
+  toolbar.ResizeDividers( newSize );
+
+  DALI_TEST_CHECK( toolbar );
+  END_TEST;
+}