Changed Animation API enums to uppercase.
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-Builder.cpp
index 60f4a1b..987916c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  */
 
 #include <iostream>
-#include <stdlib.h>
+#include <iterator>
+#include <vector>
+#include <algorithm>
+#include <cstdlib>
+
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/devel-api/builder/builder.h>
+#include <dali-toolkit/devel-api/builder/base64-encoding.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <test-button.h>
 #include <test-animation-data.h>
+#include <dummy-control.h>
+
 
 #define STRINGIFY(A)#A
 
@@ -129,7 +136,7 @@ int UtcDaliBuilderQuitSignal(void)
   );
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors ( application.GetScene().GetRootLayer() );
 
   // Connect to builder's quit signal
   bool functorCalled( false );
@@ -270,6 +277,21 @@ int UtcDaliBuilderAnimationP(void)
         "          \"duration\": 3"
         "        }"
         "      }]"
+        "    },"
+        "    \"pathAnimation2\": {"
+        "      \"duration\": 3.0,"
+        "      \"endAction\": \"BAKE_FINAL\","
+        "      \"disconnectAction\": \"DISCARD\","
+        "      \"properties\": [{"
+        "        \"actor\": \"greeting\","
+        "        \"path\":\"path0\","
+        "        \"forward\":[1,0,0],"
+        "        \"alphaFunction\": \"EASE_IN_OUT\","
+        "        \"timePeriod\": {"
+        "          \"delay\": 0,"
+        "          \"duration\": 3"
+        "        }"
+        "      }]"
         "    }"
         "  },"
         "  \"stage\": [{"
@@ -290,7 +312,7 @@ int UtcDaliBuilderAnimationP(void)
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors( application.GetScene().GetRootLayer() );
 
   Animation anim = builder.CreateAnimation("animate");
 
@@ -306,6 +328,10 @@ int UtcDaliBuilderAnimationP(void)
 
   DALI_TEST_CHECK( anim );
 
+  anim = builder.CreateAnimation("pathAnimation2");
+
+  DALI_TEST_CHECK( anim );
+
   // trigger play
   // Emit touch event and check that our quit method is called
   Integration::TouchEvent touchEvent;
@@ -420,7 +446,7 @@ int UtcDaliBuilderAnimationN(void)
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors( application.GetScene().GetRootLayer() );
 
   Animation anim = builder.CreateAnimation("animate");
 
@@ -441,11 +467,11 @@ int UtcDaliBuilderAnimationN(void)
   DALI_TEST_CHECK(anim);
 
   // alternative actor to use for FindChildByName
-  anim = builder.CreateAnimation("animate2", Dali::Stage::GetCurrent().GetRootLayer());
+  anim = builder.CreateAnimation("animate2", application.GetScene().GetRootLayer());
   DALI_TEST_CHECK(anim);
 
   // alternative actor to use for FindChildByName
-  anim = builder.CreateAnimation("animate2", map, Dali::Stage::GetCurrent().GetRootLayer());
+  anim = builder.CreateAnimation("animate2", map, application.GetScene().GetRootLayer());
   DALI_TEST_CHECK(anim);
 
 
@@ -504,10 +530,10 @@ int UtcDaliBuilderConstantsP(void)
 
   DALI_TEST_CHECK( value.GetType() != Property::NONE );
 
-  builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors ( application.GetScene().GetRootLayer() );
   DALI_TEST_CHECK( builder );
 
-  Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("image");
+  Actor actor = application.GetScene().GetRootLayer().FindChildByName("image");
   DALI_TEST_CHECK( actor );
 
   END_TEST;
@@ -675,13 +701,13 @@ int UtcDaliBuilderRenderTasksP(void)
   Builder builder = Builder::New();
   builder.LoadFromString( json );
 
-  unsigned int count = Stage::GetCurrent().GetRenderTaskList().GetTaskCount();
+  unsigned int count = application.GetScene().GetRenderTaskList().GetTaskCount();
 
   // coverage
   builder.CreateRenderTask( "task0" );
 
   DALI_TEST_CHECK( count <
-                   Stage::GetCurrent().GetRenderTaskList().GetTaskCount() );
+                   application.GetScene().GetRenderTaskList().GetTaskCount() );
 
   END_TEST;
 }
@@ -716,7 +742,7 @@ int UtcDaliBuilderChildActionP(void)
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors ( application.GetScene().GetRootLayer() );
 
   // Render and notify
   application.SendNotification();
@@ -734,10 +760,10 @@ int UtcDaliBuilderChildActionP(void)
   application.SendNotification();
   application.Render();
 
-  Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
+  Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
   DALI_TEST_CHECK( actor );
 
-  DALI_TEST_CHECK( !actor.IsVisible() );
+  DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
 
   END_TEST;
 }
@@ -773,7 +799,7 @@ int UtcDaliBuilderSetPropertyActionP(void)
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors ( application.GetScene().GetRootLayer() );
 
   // Render and notify
   application.SendNotification();
@@ -791,10 +817,10 @@ int UtcDaliBuilderSetPropertyActionP(void)
   application.SendNotification();
   application.Render();
 
-  Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
+  Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
   DALI_TEST_CHECK( actor );
 
-  DALI_TEST_CHECK( !actor.IsVisible() );
+  DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
 
   END_TEST;
 }
@@ -827,7 +853,7 @@ int UtcDaliBuilderGenericActionP(void)
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors ( application.GetScene().GetRootLayer() );
 
   // Render and notify
   application.SendNotification();
@@ -845,10 +871,10 @@ int UtcDaliBuilderGenericActionP(void)
   application.SendNotification();
   application.Render();
 
-  Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("actor");
+  Actor actor = application.GetScene().GetRootLayer().FindChildByName("actor");
   DALI_TEST_CHECK( actor );
 
-  DALI_TEST_CHECK( !actor.IsVisible() );
+  DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
 
   END_TEST;
 }
@@ -912,7 +938,7 @@ int UtcDaliBuilderPropertyNotificationP(void)
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors ( application.GetScene().GetRootLayer() );
 
   // Render and notify
   application.SendNotification();
@@ -934,10 +960,10 @@ int UtcDaliBuilderPropertyNotificationP(void)
   application.SendNotification();
   application.Render();
 
-  Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("actor");
+  Actor actor = application.GetScene().GetRootLayer().FindChildByName("actor");
   DALI_TEST_CHECK( actor );
 
-  DALI_TEST_CHECK( actor.IsVisible() );
+  DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
 
   END_TEST;
 }
@@ -965,7 +991,7 @@ int UtcDaliBuilderPropertyNotificationN(void)
   {
     Builder builder = Builder::New();
     builder.LoadFromString( json );
-    builder.AddActors ( Stage::GetCurrent().GetRootLayer() );
+    builder.AddActors ( application.GetScene().GetRootLayer() );
     DALI_TEST_CHECK( false );
   }
   catch(...)
@@ -1065,7 +1091,7 @@ int UtcDaliBuilderCustomShaderP(void)
     "      },\n"
     "      \"signals\": [\n"
     "        {\n"
-    "          \"name\": \"onStage\",\n"
+    "          \"name\": \"onScene\",\n"
     "          \"action\": \"play\",\n"
     "          \"animation\": \"Animation_1\"\n"
     "        }\n"
@@ -1096,13 +1122,13 @@ int UtcDaliBuilderCustomShaderP(void)
   Builder builder = Builder::New();
   builder.LoadFromString( json );
 
-  builder.AddActors ( "stage", Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors ( "stage", application.GetScene().GetRootLayer() );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
-  Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("Image1");
+  Actor actor = application.GetScene().GetRootLayer().FindChildByName("Image1");
 
   // coverage
   DALI_TEST_CHECK( actor );
@@ -1183,136 +1209,16 @@ int UtcDaliBuilderAddActorsP(void)
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors ( "arbitarysection", Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors ( "arbitarysection", application.GetScene().GetRootLayer() );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
-  Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("subActor");
+  Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
   DALI_TEST_CHECK( actor );
 
-  DALI_TEST_CHECK( !actor.IsVisible() );
-
-  END_TEST;
-}
-
-int UtcDaliBuilderFrameBufferP(void)
-{
-  ToolkitTestApplication application;
-
-  // JSON with a quit event when the actor is touched
-  std::string json(
-    "{\n"
-    "  \"constants\":\n"
-    "  {\n"
-    "    \"FB_WIDTH\": 200.0,\n"
-    "    \"FB_HEIGHT\": 200.0,\n"
-    "    \"FB_SIZE\": [200,200],\n"
-    "    \"FB_ASPECT_RATIO\": 1\n"
-    "  },\n"
-    "  \"stage\": [\n"
-    "    {\n"
-    "      \"type\": \"ImageView\",\n"
-    "      \"name\": \"fbOnStage\",\n"
-    "      \"position\": [\n"
-    "        0.40461349487305,\n"
-    "        0.9150390625,\n"
-    "        0.0\n"
-    "      ],\n"
-    "      \"parentOrigin\": [0.5, 0.5, 0.5],\n"
-    "      \"size\": [300, 300, 0],\n"
-    "      \"image\": \"fb0\",\n"
-    "      \"clearColor\": [1,0,0,1]\n"
-    "    },\n"
-    "    {\n"
-    "      \"type\": \"ImageView\",\n"
-    "      \"name\": \"Image1\",\n"
-    "      \"size\": [200, 200, 0],\n"
-    "      \"parentOrigin\": [0.5, 0.5, 0.5],\n"
-    "      \"effect\": \"Ripple2D\",\n"
-    "      \"image\": {\n"
-    "        \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
-    "      },\n"
-    "      \"signals\": [\n"
-    "        {\n"
-    "          \"name\": \"onStage\",\n"
-    "          \"action\": \"play\",\n"
-    "          \"animation\": \"Animation_1\"\n"
-    "        }\n"
-    "      ]\n"
-    "    },\n"
-    "    {\n"
-    "      \"type\":\"CameraActor\",\n"
-    "      \"name\":\"fbCam\",\n"
-    "      \"aspectRatio\": \"{FB_ASPECT_RATIO}\",\n"
-    "      \"projectionMode\": \"PERSPECTIVE_PROJECTION\",\n"
-    "      \"fieldOfView\": 0.785,\n"
-    "      \"invertYAxis\": true\n"
-    "    }\n"
-    "  ],\n"
-    "  \"frameBufferImages\":\n"
-    "  {\n"
-    "    \"fb0\":\n"
-    "    {\n"
-    "      \"type\": \"FrameBufferImage\",\n"
-    "      \"width\": { \"typeCast\":\"float\", \"value\":\"{FB_WIDTH}\" },\n"
-    "      \"height\": { \"typeCast\":\"float\", \"value\":\"{FB_HEIGHT}\" }\n"
-    "    }\n"
-    "  },\n"
-    "  \"renderTasks\":\n"
-    "  {\n"
-    "    \"stage\":\n"
-    "    [\n"
-    "      {\n"
-    "        \"sourceActor\": \"fbOnStage\"\n"
-    "      },\n"
-    "      {\n"
-    "        \"sourceActor\": \"Image1\",\n"
-    "        \"targetFrameBuffer\": \"fb0\",\n"
-    "        \"viewportSize\":\"{FB_SIZE}\",\n"
-    "        \"cameraActor\":\"fbCam\"\n"
-    "      }\n"
-    "    ]\n"
-    "  },\n"
-    "  \"paths\": {},\n"
-    "  \"animations\": {\n"
-    "    \"Animation_1\": {\n"
-    "      \"loop\":true,\n"
-    "      \"properties\": [\n"
-    "        {\n"
-    "          \"actor\": \"Image1\",\n"
-    "          \"property\": \"uTime\",\n"
-    "          \"value\": 10.0,\n"
-    "          \"alphaFunction\": \"LINEAR\",\n"
-    "          \"timePeriod\": {\n"
-    "            \"delay\": 0,\n"
-    "            \"duration\": 10.0\n"
-    "          },\n"
-    "          \"gui-builder-timeline-color\": \"#8dc0da\"\n"
-    "        }\n"
-    "      ]\n"
-    "    }\n"
-    "  }\n"
-    "}\n");
-
-  Builder builder = Builder::New();
-
-  // frame buffer coverage
-  builder.LoadFromString( json );
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  Dali::FrameBufferImage frameBuffer = builder.GetFrameBufferImage( "fb0" );
-  DALI_TEST_CHECK( frameBuffer );
-
-  Dali::FrameBufferImage frameBuffer2 = builder.GetFrameBufferImage( "fb0" );
-  DALI_TEST_CHECK( frameBuffer2 );
-  DALI_TEST_CHECK( frameBuffer == frameBuffer2 );
-
-  DALI_TEST_CHECK( true );
+  DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
 
   END_TEST;
 }
@@ -1343,12 +1249,12 @@ int UtcDaliBuilderPathConstraintsP(void)
     "      },\n"
     "      \"signals\": [\n"
     "        {\n"
-    "          \"name\": \"onStage\",\n"
+    "          \"name\": \"onScene\",\n"
     "          \"action\": \"play\",\n"
     "          \"animation\": \"pathAnimation\"\n"
     "        },\n"
     "        {\n"
-    "          \"name\": \"onStage\",\n"
+    "          \"name\": \"onScene\",\n"
     "          \"action\": \"applyConstraint\",\n"
     "          \"constrainer\": \"constrainer0\",\n"
     "          \"properties\":\n"
@@ -1363,7 +1269,7 @@ int UtcDaliBuilderPathConstraintsP(void)
     "          ]\n"
     "        },\n"
     "        {\n"
-    "          \"name\": \"onStage\",\n"
+    "          \"name\": \"onScene\",\n"
     "          \"action\": \"applyConstraint\",\n"
     "          \"constrainer\": \"constrainer1\",\n"
     "          \"properties\":\n"
@@ -1378,7 +1284,7 @@ int UtcDaliBuilderPathConstraintsP(void)
     "          ]\n"
     "        },\n"
     "        {\n"
-    "          \"name\": \"offStage\",\n"
+    "          \"name\": \"offScene\",\n"
     "          \"action\": \"removeConstraints\",\n"
     "          \"constrainer\": \"constrainer0\",\n"
     "          \"properties\":\n"
@@ -1393,7 +1299,7 @@ int UtcDaliBuilderPathConstraintsP(void)
     "          ]\n"
     "        },\n"
     "        {\n"
-    "          \"name\": \"offStage\",\n"
+    "          \"name\": \"offScene\",\n"
     "          \"action\": \"removeConstraints\",\n"
     "          \"constrainer\": \"constrainer1\",\n"
     "          \"properties\":\n"
@@ -1509,7 +1415,7 @@ int UtcDaliBuilderPathConstraintsP(void)
   // For coverage
 
   Actor actor = Actor::New();
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
   builder.AddActors( actor );
 
   // Render and notify
@@ -1615,7 +1521,7 @@ int UtcDaliBuilderMapping01(void)
   builder.LoadFromString( json );
 
   Test::TestButton testButton = Test::TestButton::New();
-  Stage::GetCurrent().Add( testButton );
+  application.GetScene().Add( testButton );
 
   // Render and notify
   application.SendNotification();
@@ -1687,7 +1593,7 @@ int UtcDaliBuilderMappingCycleCheck(void)
   builder.LoadFromString( json );
 
   Test::TestButton testButton = Test::TestButton::New();
-  Stage::GetCurrent().Add( testButton );
+  application.GetScene().Add( testButton );
 
   // Render and notify
   application.SendNotification();
@@ -1727,13 +1633,14 @@ int UtcDaliBuilderTypeCasts(void)
          "\"sensitive\":   { \"typeCast\":\"boolean\", \"value\":false },"
          "\"orientation\": { \"typeCast\":\"rotation\", \"value\":[10,10,10,10] },"
          "\"colorMode\":   { \"typeCast\":\"string\", \"value\":\"USE_OWN_MULTIPLY_PARENT_COLOR\" },"
-         "\"clippingBox\": { \"typeCast\":\"rect\", \"value\":[10,10,10,10] }"
+         "\"clippingBox\": { \"typeCast\":\"rect\", \"value\":[10,10,10,10] },"
+         "\"padding\":     { \"typeCast\":\"extents\", \"value\":[10,10,10,10] }"
       "}]"
     "}"
   );
 
   Actor rootActor = Actor::New();
-  Stage::GetCurrent().Add( rootActor );
+  application.GetScene().Add( rootActor );
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
@@ -1743,11 +1650,11 @@ int UtcDaliBuilderTypeCasts(void)
   application.Render();
 
   Actor createdActor = rootActor.GetChildAt( 0 );
-  DALI_TEST_EQUALS( createdActor.GetMaximumSize(), Vector2(100.0f,15.0f), TEST_LOCATION );
-  DALI_TEST_EQUALS( createdActor.GetCurrentPosition(), Vector3(100.0f,10.0f,1.0f), TEST_LOCATION );
-  DALI_TEST_EQUALS( createdActor.GetCurrentColor(), Vector4(0.5f,0.5f,0.5f,1.0f), TEST_LOCATION );
-  DALI_TEST_EQUALS( createdActor.IsSensitive(), false, TEST_LOCATION );
-  DALI_TEST_EQUALS( createdActor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ), Vector2(100.0f,15.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(100.0f,10.0f,1.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Vector4(0.5f,0.5f,0.5f,1.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetProperty< bool >( Actor::Property::SENSITIVE ), false, TEST_LOCATION );
+  DALI_TEST_EQUALS( createdActor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1770,7 +1677,7 @@ int UtcDaliBuilderBuilderControl(void)
   );
 
   Actor rootActor = Actor::New();
-  Stage::GetCurrent().Add( rootActor );
+  application.GetScene().Add( rootActor );
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
@@ -1784,6 +1691,43 @@ int UtcDaliBuilderBuilderControl(void)
   END_TEST;
 }
 
+int UtcDaliBuilderCustomControl(void)
+{
+  ToolkitTestApplication application;
+
+  std::string json(
+    "{"
+       "\"stage\":"
+       "[{"
+         "\"type\": \"DummyControl\","
+         "\"name\": \"I can haz custom Control\""
+      "}]"
+    "}"
+  );
+
+  Actor rootActor = Actor::New();
+  application.GetScene().Add( rootActor );
+
+  Builder builder = Builder::New();
+  builder.LoadFromString( json );
+  builder.AddActors( rootActor );
+
+  application.SendNotification();
+  application.Render();
+
+  Actor customControl = rootActor.FindChildByName( "I can haz custom Control" );
+
+  // Test that we have the correct type of custom control
+  DummyControl dummyControl = DummyControl::DownCast( customControl );
+  DALI_TEST_CHECK( dummyControl );
+  if( dummyControl )
+  {
+    DALI_TEST_CHECK( typeid(dummyControl.GetImplementation()) == typeid(DummyControlImpl) );
+  }
+
+  END_TEST;
+}
+
 int UtcDaliBuilderActionsWithParams(void)
 {
   ToolkitTestApplication application;
@@ -1814,9 +1758,292 @@ int UtcDaliBuilderActionsWithParams(void)
 
   Builder builder = Builder::New();
   builder.LoadFromString( json );
-  builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+  builder.AddActors( application.GetScene().GetRootLayer() );
 
   DALI_TEST_CHECK( true ); // For Coverage
 
   END_TEST;
 }
+
+int UtcDaliBuilderConfigurationP(void)
+{
+  ToolkitTestApplication application;
+
+  // JSON with a quit event when the actor is touched
+  std::string json(
+      "{\n"
+      "  \"config\":\n"
+      "  {\n"
+      "    \"alwaysShowFocus\":true\n"
+      "  }\n"
+      "}\n"
+  );
+
+  Builder builder = Builder::New();
+  builder.LoadFromString( json );
+
+  Property::Map map = builder.GetConfigurations();
+
+  Dali::Property::Value* pValue = map.Find( "alwaysShowFocus" );
+
+  DALI_TEST_CHECK( pValue );
+
+  bool value = pValue->Get<bool>();
+
+  DALI_TEST_CHECK( value );
+
+  END_TEST;
+}
+
+
+int UtcDaliBase64EncodingP(void)
+{
+  std::vector<uint32_t> data = { 0, 1, 2, 3, 4, 5, std::numeric_limits<uint32_t>::min(), std::numeric_limits<uint32_t>::max()  };
+
+  Property::Value value;
+  EncodeBase64PropertyData( value, data );
+
+  std::cout << "Max uint32_t:" << std::numeric_limits<uint32_t>::max() << std::endl;
+  std::cout << "Input data:  ";
+  std::ostream_iterator<uint32_t> out_it (std::cout,", ");
+  std::copy ( data.begin(), data.end(), out_it );
+  std::cout << std::endl;
+
+  std::string output;
+  DALI_TEST_CHECK( value.Get( output ) );
+  DALI_TEST_EQUALS( output, "AAAAAAEAAAACAAAAAwAAAAQAAAAFAAAAAAAAAP////8", TEST_LOCATION );
+
+  std::cout << "Output data:  " << output << std::endl;
+
+  END_TEST;
+}
+
+int UtcDaliBase64EncodingN(void)
+{
+  tet_infoline( "Test encoding an empty vector returns empty string" );
+  std::vector<uint32_t> data;
+
+  Property::Value value;
+  EncodeBase64PropertyData( value, data );
+
+  std::string output;
+  DALI_TEST_CHECK( value.Get( output ) );
+  DALI_TEST_EQUALS( output.empty(), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+template <typename T>
+int b64l(std::vector<T>&data)
+{
+  auto lengthInBytes = 4*data.size();
+  return ceil( lengthInBytes * 1.33333f );
+}
+
+int UtcDaliBase64EncodingP02(void)
+{
+  tet_infoline( "Test encoding vectors of lengths m .. m+4 encode and decode back to the same length vectors" );
+
+  std::vector<uint32_t> testData;
+  for(int i=0; i<8; ++i ) // 8 chosen to stay within single string output
+  {
+    testData.push_back(i);
+  }
+  Property::Value value;
+  EncodeBase64PropertyData( value, testData );
+
+  std::string output;
+  DALI_TEST_CHECK( value.Get( output ) );
+  DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
+  DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+
+  std::vector<uint32_t> outData;
+  DecodeBase64PropertyData( value, outData );
+  DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+  DALI_TEST_EQUALS( std::equal( testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION );
+
+  // n+1
+  testData.push_back( 12345 );
+  EncodeBase64PropertyData( value, testData );
+
+  DALI_TEST_CHECK( value.Get( output ) );
+  DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
+  DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+
+  outData.clear();
+  DecodeBase64PropertyData( value, outData );
+  DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+  DALI_TEST_EQUALS( std::equal( testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION );
+
+  // n+2
+  testData.push_back( 67890 );
+  EncodeBase64PropertyData( value, testData );
+
+  DALI_TEST_CHECK( value.Get( output ) );
+  DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
+  DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+
+  outData.clear();
+  DecodeBase64PropertyData( value, outData );
+  DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+  DALI_TEST_EQUALS( std::equal( testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION );
+
+  // n+3
+  testData.push_back( -1 );
+  EncodeBase64PropertyData( value, testData );
+
+  DALI_TEST_CHECK( value.Get( output ) );
+  DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
+  DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+
+  outData.clear();
+  DecodeBase64PropertyData( value, outData );
+  DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+  DALI_TEST_EQUALS( std::equal( testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+
+int UtcDaliBase64EncodingP03(void)
+{
+  tet_infoline( "Test encoding a vector of length 12 has output within single string" );
+
+  std::vector<uint32_t> testData;
+  for(int i=0; i<12; ++i )
+  {
+    testData.push_back(i);
+  }
+  Property::Value value;
+  EncodeBase64PropertyData( value, testData );
+
+  std::string output;
+  DALI_TEST_CHECK( value.Get( output ) );
+  DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
+  DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+
+  std::vector<uint32_t> outData;
+  DecodeBase64PropertyData( value, outData );
+  DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliBase64EncodingP04(void)
+{
+  tet_infoline( "Test encoding a vector of length 13 has output split over 2 strings" );
+
+  std::vector<uint32_t> testData;
+  for(int i=0; i<13; ++i )
+  {
+    testData.push_back(i);
+  }
+  Property::Value value;
+  EncodeBase64PropertyData( value, testData );
+
+  auto array = value.GetArray();
+  DALI_TEST_CHECK( array );
+
+  DALI_TEST_EQUALS( array->Count(), 2, TEST_LOCATION );
+
+  std::vector<uint32_t> outData;
+  DecodeBase64PropertyData( value, outData );
+  DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliBase64EncodingP05(void)
+{
+  tet_infoline( "Test encoding a vector of length 24 has output split over 2 strings" );
+
+  std::vector<uint32_t> testData;
+  for(int i=0; i<24; ++i )
+  {
+    testData.push_back(i);
+  }
+  Property::Value value;
+  EncodeBase64PropertyData( value, testData );
+
+  auto array = value.GetArray();
+  DALI_TEST_CHECK( array );
+
+  DALI_TEST_EQUALS( array->Count(), 2, TEST_LOCATION );
+
+  std::vector<uint32_t> outData;
+  DecodeBase64PropertyData( value, outData );
+  DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliBase64EncodingP06(void)
+{
+  tet_infoline( "Test encoding a vector of arbitrary length decodes OK." );
+
+  std::vector<uint32_t> testData;
+  for(int i=0; i<97; ++i )
+  {
+    testData.push_back(i);
+  }
+  Property::Value value;
+  EncodeBase64PropertyData( value, testData );
+
+  auto array = value.GetArray();
+  DALI_TEST_CHECK( array );
+
+  std::vector<uint32_t> outData;
+  DecodeBase64PropertyData( value, outData );
+  DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliBase64DecodingN01(void)
+{
+  tet_infoline( "Test decoding empty string results in empty data" );
+
+  Property::Value value("");
+  std::vector<uint32_t> outputData;
+  DecodeBase64PropertyData( value, outputData);
+  DALI_TEST_EQUALS( outputData.size(), 0, TEST_LOCATION );
+  END_TEST;
+}
+
+
+int UtcDaliBase64DecodingN02(void)
+{
+  tet_infoline( "Test decoding array with non-string values results in empty data" );
+
+  Property::Array array;
+  array.Resize(2);
+  array[0] = "Stuff, things";
+  array[1] = 1;
+  Property::Value value(array);
+
+  std::vector<uint32_t> outputData;
+  DecodeBase64PropertyData( value, outputData);
+  DALI_TEST_EQUALS( outputData.size(), 0, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliBase64DecodingP01(void)
+{
+  tet_infoline( "Test decoding string of known data gives expected result");
+
+  std::string testInput("//////7+/v4DAgEA");
+  std::vector<uint32_t> expectedResults = { 0xffffffff, 0xfefefefe, 0x00010203 };
+
+  std::vector<uint32_t> outputData;
+  DecodeBase64PropertyData(Property::Value(testInput), outputData);
+
+  DALI_TEST_EQUALS( std::equal( expectedResults.begin(), expectedResults.end(), outputData.begin() ), true,
+                    TEST_LOCATION );
+
+  END_TEST;
+}