+int UtcDaliVisualTestTransformPoliciesAsStrings(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcDaliVisualTestTransformPoliciesAsStrings: Use a ColorVisual and test the offset and size policies as strings" );
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
+ Visual::Base visual = factory.CreateVisual( propertyMap );
+
+ Property::Map transform;
+ transform[ "offsetPolicy" ] = Property::Array().Add( "ABSOLUTE" )
+ .Add( "RELATIVE" );
+ transform[ "sizePolicy" ] = Property::Array().Add( "RELATIVE" )
+ .Add( "ABSOLUTE" );
+ visual.SetTransformAndSize( transform, Vector2(100, 100) );
+
+ Dali::Property::Map visualMap;
+ visual.CreatePropertyMap( visualMap );
+ Property::Value* value = visualMap.Find( Dali::Toolkit::DevelVisual::Property::TRANSFORM );
+ Dali::Property::Map* map = value->GetMap();
+ DALI_TEST_CHECK( map );
+
+ {
+ Property::Value* typeValue = map->Find( Toolkit::DevelVisual::Transform::Property::OFFSET_POLICY );
+ DALI_TEST_CHECK( typeValue );
+ DALI_TEST_EQUALS( typeValue->Get< Vector2 >(), Vector2( Toolkit::DevelVisual::Transform::Policy::ABSOLUTE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ), TEST_LOCATION );
+ }
+ {
+ Property::Value* typeValue = map->Find( Toolkit::DevelVisual::Transform::Property::SIZE_POLICY );
+ DALI_TEST_CHECK( typeValue );
+ DALI_TEST_EQUALS( typeValue->Get< Vector2 >(), Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ }
+
+ END_TEST;
+}
+