[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-scene3d / utc-Dali-SceneView.cpp
index 58bcab0..06ff712 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -20,8 +20,9 @@
 #include <stdlib.h>
 #include <iostream>
 
-#include <dali-scene3d/public-api/controls/model-view/model-view.h>
+#include <dali-scene3d/public-api/controls/model/model.h>
 #include <dali-scene3d/public-api/controls/scene-view/scene-view.h>
+#include <toolkit-event-thread-callback.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -50,7 +51,7 @@ const char* TEST_GLTF_FILE_NAME = TEST_RESOURCE_DIR "/AnimatedCube.gltf";
  * These textures are based off version of Wave engine sample
  * Take from https://github.com/WaveEngine/Samples
  *
- * Copyright (c) 2022 Wave Coorporation
+ * Copyright (c) 2024 Wave Coorporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -70,23 +71,26 @@ const char* TEST_GLTF_FILE_NAME = TEST_RESOURCE_DIR "/AnimatedCube.gltf";
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-const char* TEST_DIFFUSE_TEXTURE  = TEST_RESOURCE_DIR "/forest_irradiance.ktx";
-const char* TEST_SPECULAR_TEXTURE = TEST_RESOURCE_DIR "/forest_radiance.ktx";
+const char* TEST_EQUIRECTANGULAR_TEXTURE = TEST_RESOURCE_DIR "/application-icon-20.png";
+const char* TEST_DIFFUSE_TEXTURE         = TEST_RESOURCE_DIR "/forest_irradiance.ktx";
+const char* TEST_SPECULAR_TEXTURE        = TEST_RESOURCE_DIR "/forest_radiance.ktx";
+const char* TEST_DIFFUSE_TEXTURE2        = TEST_RESOURCE_DIR "//forest_irradiance.ktx";
+const char* TEST_SPECULAR_TEXTURE2       = TEST_RESOURCE_DIR "//forest_radiance.ktx";
 
-Dali::Texture GetDiffuseTexture(Dali::Scene3D::ModelView modelView)
+Dali::Texture GetDiffuseTexture(Dali::Scene3D::Model model)
 {
   Dali::Texture texture;
 
-  Actor meshActor = modelView.FindChildByName("AnimatedCube");
+  Actor meshActor = model.FindChildByName("AnimatedCube");
   if(meshActor)
   {
     Renderer renderer = meshActor.GetRendererAt(0u);
     if(renderer)
     {
       TextureSet textureSet = renderer.GetTextures();
-      if(textureSet.GetTextureCount() == 7u)
+      if(textureSet.GetTextureCount() == 10u)
       {
-        texture = textureSet.GetTexture(5u);
+        texture = textureSet.GetTexture(8u);
       }
     }
   }
@@ -94,26 +98,39 @@ Dali::Texture GetDiffuseTexture(Dali::Scene3D::ModelView modelView)
   return texture;
 }
 
-Dali::Texture GetSpecularTexture(Dali::Scene3D::ModelView modelView)
+Dali::Texture GetSpecularTexture(Dali::Scene3D::Model model)
 {
   Dali::Texture texture;
 
-  Actor meshActor = modelView.FindChildByName("AnimatedCube");
+  Actor meshActor = model.FindChildByName("AnimatedCube");
   if(meshActor)
   {
     Renderer renderer = meshActor.GetRendererAt(0u);
     if(renderer)
     {
       TextureSet textureSet = renderer.GetTextures();
-      if(textureSet.GetTextureCount() == 7u)
+      if(textureSet.GetTextureCount() == 10u)
       {
-        texture = textureSet.GetTexture(6u);
+        texture = textureSet.GetTexture(9u);
       }
     }
   }
 
   return texture;
 }
+
+// For ResourceReady
+static bool gOnRelayoutCallBackCalled = false;
+void        OnRelayoutCallback(Actor actor)
+{
+  gOnRelayoutCallBackCalled = true;
+}
+
+static bool gResourceReadyCalled = false;
+void        OnResourceReady(Control control)
+{
+  gResourceReadyCalled = true;
+}
 } // namespace
 
 // Negative test case for a method
@@ -126,7 +143,7 @@ int UtcDaliSceneViewUninitialized(void)
 
   try
   {
-    // New() must be called to create a ModelView or it wont be valid.
+    // New() must be called to create a Model or it wont be valid.
     Actor a = Actor::New();
     view.Add(a);
     DALI_TEST_CHECK(false);
@@ -181,8 +198,8 @@ int UtcDaliSceneViewTypeRegistry(void)
   BaseHandle handle = typeInfo.CreateInstance();
   DALI_TEST_CHECK(handle);
 
-  Scene3D::SceneView modelView = Scene3D::SceneView::DownCast(handle);
-  DALI_TEST_CHECK(modelView);
+  Scene3D::SceneView model = Scene3D::SceneView::DownCast(handle);
+  DALI_TEST_CHECK(model);
 
   END_TEST;
 }
@@ -296,22 +313,24 @@ int UtcDaliSceneViewOnScene02(void)
 {
   ToolkitTestApplication application;
 
-  uint32_t renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
-  DALI_TEST_EQUALS(1u, renderTaskCount, TEST_LOCATION);
+  uint32_t baseRenderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
 
   Scene3D::SceneView view = Scene3D::SceneView::New();
 
-  renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
-  DALI_TEST_EQUALS(2u, renderTaskCount, TEST_LOCATION);
-
-  RenderTask  renderTask = application.GetScene().GetRenderTaskList().GetTask(1u);
-  CameraActor camera     = renderTask.GetCameraActor();
+  uint32_t renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
+  DALI_TEST_EQUALS(baseRenderTaskCount, renderTaskCount, TEST_LOCATION);
 
   application.GetScene().Add(view);
 
   application.SendNotification();
   application.Render();
 
+  renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
+  DALI_TEST_EQUALS(baseRenderTaskCount + 1u, renderTaskCount, TEST_LOCATION);
+
+  RenderTask  renderTask = application.GetScene().GetRenderTaskList().GetTask(baseRenderTaskCount);
+  CameraActor camera     = renderTask.GetCameraActor();
+
   CameraActor defaultCamera = renderTask.GetCameraActor();
   DALI_TEST_CHECK(defaultCamera);
   DALI_TEST_EQUALS(camera, defaultCamera, TEST_LOCATION);
@@ -413,11 +432,12 @@ int UtcDaliSceneViewAddRemoveCamera(void)
   END_TEST;
 }
 
-int UtcDaliSceneViewImageBasedLight(void)
+int UtcDaliSceneViewImageBasedLight01(void)
 {
   ToolkitTestApplication application;
 
   Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.ResourceReadySignal().Connect(OnResourceReady);
   view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
 
   application.GetScene().Add(view);
@@ -425,31 +445,65 @@ int UtcDaliSceneViewImageBasedLight(void)
   application.SendNotification();
   application.Render();
 
-  Scene3D::ModelView modelView1 = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
-  Scene3D::ModelView modelView2 = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
-  Scene3D::ModelView modelView3 = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  Scene3D::Model modelView1 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
+  Scene3D::Model modelView2 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
+  Scene3D::Model modelView3 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
   view.Add(modelView1);
   view.Add(modelView2);
 
-  DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), 0.0f, TEST_LOCATION);
-  DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), 0.0f, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), TEST_LOCATION);
+  DALI_TEST_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), TEST_LOCATION);
   DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView3), 0.0f, TEST_LOCATION);
   DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView3), 0.0f, TEST_LOCATION);
 
+  gResourceReadyCalled = false;
+  DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
   view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
 
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
+
   DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), TEST_LOCATION);
   DALI_TEST_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), TEST_LOCATION);
   DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView3), 0.0f, TEST_LOCATION);
   DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView3), 0.0f, TEST_LOCATION);
 
   view.Add(modelView3);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
 
   DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView3), TEST_LOCATION);
   DALI_TEST_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView3), TEST_LOCATION);
 
   view.Remove(modelView1);
-  view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
+
+  gResourceReadyCalled = false;
+  DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
+  view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE2, TEST_SPECULAR_TEXTURE2);
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
 
   DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), GetDiffuseTexture(modelView2), 0.0f, TEST_LOCATION);
   DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), GetSpecularTexture(modelView2), 0.0f, TEST_LOCATION);
@@ -461,6 +515,128 @@ int UtcDaliSceneViewImageBasedLight(void)
   END_TEST;
 }
 
+int UtcDaliSceneViewImageBasedLight02(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.ResourceReadySignal().Connect(OnResourceReady);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Scene3D::Model modelView1 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
+  modelView1.ResourceReadySignal().Connect(OnResourceReady);
+  view.Add(modelView1);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  gResourceReadyCalled = false;
+  DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
+  view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
+
+  Dali::Texture diffuseTexture  = GetDiffuseTexture(modelView1);
+  Dali::Texture specularTexture = GetSpecularTexture(modelView1);
+
+  gResourceReadyCalled = false;
+  DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
+  modelView1.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE2, TEST_SPECULAR_TEXTURE2);
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
+
+  DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
+  DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
+  diffuseTexture  = GetDiffuseTexture(modelView1);
+  specularTexture = GetSpecularTexture(modelView1);
+
+  // reset SceneView IBL
+  view.SetImageBasedLightSource("", "");
+  DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, TEST_LOCATION);
+  DALI_TEST_EQUALS(GetSpecularTexture(modelView1), specularTexture, TEST_LOCATION);
+
+  modelView1.SetImageBasedLightSource("", "");
+  DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
+  DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewImageBasedLight03(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
+  view.ResourceReadySignal().Connect(OnResourceReady);
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  Scene3D::Model modelView1 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
+  view.Add(modelView1);
+  modelView1.SetImageBasedLightSource(TEST_SPECULAR_TEXTURE, TEST_DIFFUSE_TEXTURE);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  Dali::Texture diffuseTexture  = GetDiffuseTexture(modelView1);
+  Dali::Texture specularTexture = GetSpecularTexture(modelView1);
+
+  gResourceReadyCalled = false;
+  DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
+  view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE2, TEST_SPECULAR_TEXTURE2);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
+
+  DALI_TEST_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, TEST_LOCATION);
+  DALI_TEST_EQUALS(GetSpecularTexture(modelView1), specularTexture, TEST_LOCATION);
+
+  modelView1.SetImageBasedLightSource("", "");
+  DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
+  DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
+  diffuseTexture  = GetDiffuseTexture(modelView1);
+  specularTexture = GetSpecularTexture(modelView1);
+
+  // reset SceneView IBL
+  view.SetImageBasedLightSource("", "");
+  DALI_TEST_NOT_EQUALS(GetDiffuseTexture(modelView1), diffuseTexture, 0.0f, TEST_LOCATION);
+  DALI_TEST_NOT_EQUALS(GetSpecularTexture(modelView1), specularTexture, 0.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
 int UtcDaliSceneViewImageBasedFactor(void)
 {
   ToolkitTestApplication application;
@@ -473,7 +649,7 @@ int UtcDaliSceneViewImageBasedFactor(void)
   application.SendNotification();
   application.Render();
 
-  Scene3D::ModelView modelView1 = Scene3D::ModelView::New(TEST_GLTF_FILE_NAME);
+  Scene3D::Model modelView1 = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
   view.Add(modelView1);
 
   DALI_TEST_EQUALS(view.GetImageBasedLightScaleFactor(), 1.0f, TEST_LOCATION);
@@ -481,7 +657,7 @@ int UtcDaliSceneViewImageBasedFactor(void)
 
   view.SetImageBasedLightScaleFactor(0.5f);
   DALI_TEST_EQUALS(view.GetImageBasedLightScaleFactor(), 0.5f, TEST_LOCATION);
-  DALI_TEST_EQUALS(modelView1.GetImageBasedLightScaleFactor(), 0.5f, TEST_LOCATION);
+  DALI_TEST_EQUALS(modelView1.GetImageBasedLightScaleFactor(), 1.0f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -508,6 +684,8 @@ int UtcDaliSceneViewUseFramebuffer02(void)
 {
   ToolkitTestApplication application;
 
+  uint32_t baseRenderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
+
   Scene3D::SceneView view = Scene3D::SceneView::New();
   view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
 
@@ -516,7 +694,7 @@ int UtcDaliSceneViewUseFramebuffer02(void)
   application.SendNotification();
   application.Render();
 
-  RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(1u);
+  RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(baseRenderTaskCount);
   DALI_TEST_CHECK(!renderTask.GetFrameBuffer());
 
   view.UseFramebuffer(true);
@@ -525,23 +703,47 @@ int UtcDaliSceneViewUseFramebuffer02(void)
   view.UseFramebuffer(false);
   DALI_TEST_CHECK(!renderTask.GetFrameBuffer());
 
+  view.UseFramebuffer(true);
+  DALI_TEST_CHECK(renderTask.GetFrameBuffer());
+
   END_TEST;
 }
 
-// For ResourceReady
-namespace
-{
-static bool gOnRelayoutCallBackCalled = false;
-void OnRelayoutCallback(Actor actor)
+int UtcDaliSceneViewFramebufferMultiSamplingLevel(void)
 {
-  gOnRelayoutCallBackCalled = true;
-}
+  ToolkitTestApplication application;
 
-static bool gResourceReadyCalled = false;
-void OnResourceReady(Control control)
-{
-  gResourceReadyCalled = true;
-}
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
+
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint8_t expectValue        = 0u; // Default MultiSamplingLevel is 0.
+  uint8_t multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
+  DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
+
+  expectValue = 4u; // Change value.
+  view.UseFramebuffer(true);
+  view.SetFramebufferMultiSamplingLevel(expectValue);
+
+  multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
+  DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
+
+  // Note : we don't check multi sampling level is applied to framebuffer, or not.
+  view.UseFramebuffer(false);
+  expectValue = 2u; // Change value.
+  view.SetFramebufferMultiSamplingLevel(expectValue);
+
+  application.SendNotification();
+  application.Render();
+
+  multiSamplingLevel = view.GetFramebufferMultiSamplingLevel();
+  DALI_TEST_EQUALS(multiSamplingLevel, expectValue, TEST_LOCATION);
+
+  END_TEST;
 }
 
 int UtcDaliSceneViewResourceReady(void)
@@ -549,8 +751,8 @@ int UtcDaliSceneViewResourceReady(void)
   ToolkitTestApplication application;
 
   gOnRelayoutCallBackCalled = false;
-  gResourceReadyCalled = false;
-  Scene3D::SceneView view = Scene3D::SceneView::New();
+  gResourceReadyCalled      = false;
+  Scene3D::SceneView view   = Scene3D::SceneView::New();
   view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
   view.OnRelayoutSignal().Connect(OnRelayoutCallback);
   view.ResourceReadySignal().Connect(OnResourceReady);
@@ -571,15 +773,425 @@ int UtcDaliSceneViewResourceReady(void)
   DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
 
   gOnRelayoutCallBackCalled = false;
-  gResourceReadyCalled = false;
+  gResourceReadyCalled      = false;
 
   view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
 
   application.SendNotification();
   application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
 
   DALI_TEST_EQUALS(gOnRelayoutCallBackCalled, false, TEST_LOCATION);
   DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
 
   END_TEST;
 }
+
+int UtcDaliSceneViewSetSkybox(void)
+{
+  ToolkitTestApplication application;
+
+  gResourceReadyCalled    = false;
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  view.ResourceReadySignal().Connect(OnResourceReady);
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t childCount = view.GetChildAt(0u).GetChildCount();
+  view.SetSkybox(TEST_SPECULAR_TEXTURE);
+
+  gResourceReadyCalled = false;
+  DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
+
+  DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount + 1, TEST_LOCATION);
+
+  view.Unparent();
+  view.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetSkyboxEquirectangular(void)
+{
+  ToolkitTestApplication application;
+
+  gResourceReadyCalled    = false;
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  view.ResourceReadySignal().Connect(OnResourceReady);
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t childCount = view.GetChildAt(0u).GetChildCount();
+  view.SetSkyboxEnvironmentMapType(Scene3D::EnvironmentMapType::EQUIRECTANGULAR);
+  view.SetSkybox(TEST_EQUIRECTANGULAR_TEXTURE);
+
+  gResourceReadyCalled = false;
+  DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
+
+  DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount + 1, TEST_LOCATION);
+
+  view.Unparent();
+  view.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetSkyboxEmpty(void)
+{
+  ToolkitTestApplication application;
+
+  gResourceReadyCalled    = false;
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  view.ResourceReadySignal().Connect(OnResourceReady);
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t childCount = view.GetChildAt(0u).GetChildCount();
+  view.SetSkybox("");
+  DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount, TEST_LOCATION);
+
+  view.Unparent();
+  view.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetSkyboxEmpty2(void)
+{
+  ToolkitTestApplication application;
+
+  gResourceReadyCalled    = false;
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  view.ResourceReadySignal().Connect(OnResourceReady);
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  view.SetSkybox(TEST_EQUIRECTANGULAR_TEXTURE);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  uint32_t childCount = view.GetChildAt(0u).GetChildCount();
+
+  view.SetSkybox("");
+  DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount - 1, TEST_LOCATION);
+
+  view.Unparent();
+  view.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetSkyboxEquirectangularEmpty(void)
+{
+  ToolkitTestApplication application;
+
+  gResourceReadyCalled    = false;
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  view.ResourceReadySignal().Connect(OnResourceReady);
+  application.GetScene().Add(view);
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t childCount = view.GetChildAt(0u).GetChildCount();
+  view.SetSkybox("");
+  DALI_TEST_EQUALS(view.GetChildAt(0u).GetChildCount(), childCount, TEST_LOCATION);
+
+  view.Unparent();
+  view.Reset();
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetSkyboxIntensity(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+
+  float intensity = 0.5f;
+  DALI_TEST_EQUALS(view.GetSkyboxIntensity(), 1.0f, TEST_LOCATION);
+
+  view.SetSkyboxIntensity(intensity);
+  DALI_TEST_EQUALS(view.GetSkyboxIntensity(), intensity, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetSkyboxOrientation(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+
+  Dali::Quaternion orientation = Dali::Quaternion(Radian(0.5f), Vector3::YAXIS);
+  view.SetSkyboxOrientation(orientation);
+  DALI_TEST_EQUALS(view.GetSkyboxOrientation(), orientation, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetImageBasedLightAndSkybox(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.ResourceReadySignal().Connect(OnResourceReady);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
+  view.SetImageBasedLightSource(TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE);
+  view.SetSkybox(TEST_SPECULAR_TEXTURE);
+  application.GetScene().Add(view);
+
+  // Check SceneView needs 3 trigger to load both of image based light and skybox.
+  gResourceReadyCalled = false;
+  DALI_TEST_EQUALS(gResourceReadyCalled, false, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(gResourceReadyCalled, true, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewCreateAndRemoveRenderTask(void)
+{
+  ToolkitTestApplication application;
+  RenderTaskList         taskList = application.GetScene().GetRenderTaskList();
+
+  uint32_t baseRenderTaskCount = taskList.GetTaskCount();
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+
+  DALI_TEST_EQUALS(baseRenderTaskCount, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
+
+  application.GetScene().Add(view);
+
+  DALI_TEST_EQUALS(baseRenderTaskCount + 1, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
+
+  view.Unparent();
+
+  DALI_TEST_EQUALS(baseRenderTaskCount, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewColorMode(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  application.GetScene().Add(view);
+
+  DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_MULTIPLY_PARENT_ALPHA), TEST_LOCATION);
+
+  view.UseFramebuffer(true);
+
+  DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_COLOR), TEST_LOCATION);
+
+  view.UseFramebuffer(false);
+
+  DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_MULTIPLY_PARENT_ALPHA), TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetResolution(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  application.GetScene().Add(view);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
+
+  view.SetResolution(200u, 200u);
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
+
+  view.UseFramebuffer(true);
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 200u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 200u, TEST_LOCATION);
+
+  view.SetResolution(300u, 0u);
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
+
+  view.SetResolution(300u, 400u);
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 300u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 400u, TEST_LOCATION);
+
+  view.ResetResolution();
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
+
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(400, 400));
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 400u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 400u, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewSetResolution02(void)
+{
+  tet_infoline("Test whether framebuffer created well base on inputed resolution");
+  ToolkitTestApplication application;
+  RenderTaskList         renderTaskList = application.GetScene().GetRenderTaskList();
+
+  uint32_t baseRenderTaskCount = renderTaskList.GetTaskCount();
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  application.GetScene().Add(view);
+  view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
+
+  uint32_t expectWidth  = 83u;
+  uint32_t expectHeight = 207u;
+
+  view.SetResolution(expectWidth, expectHeight);
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), 100u, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), 100u, TEST_LOCATION);
+
+  tet_printf("Test Framebuffer result target created well\n");
+  view.UseFramebuffer(true);
+
+  RenderTask renderTask = renderTaskList.GetTask(baseRenderTaskCount);
+  DALI_TEST_CHECK(renderTask);
+
+  FrameBuffer frameBuffer = renderTask.GetFrameBuffer();
+  DALI_TEST_CHECK(frameBuffer);
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), expectWidth, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), expectHeight, TEST_LOCATION);
+
+  Texture renderTargetTexture = frameBuffer.GetColorTexture();
+  DALI_TEST_CHECK(renderTargetTexture);
+  DALI_TEST_EQUALS(renderTargetTexture.GetWidth(), expectWidth, TEST_LOCATION);
+  DALI_TEST_EQUALS(renderTargetTexture.GetHeight(), expectHeight, TEST_LOCATION);
+
+  tet_printf("Test Framebuffer result target created well after create new FBO, by set multisampling level\n");
+  view.SetFramebufferMultiSamplingLevel(2u);
+
+  renderTask = renderTaskList.GetTask(baseRenderTaskCount);
+  DALI_TEST_CHECK(renderTask);
+
+  frameBuffer = renderTask.GetFrameBuffer();
+  DALI_TEST_CHECK(frameBuffer);
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), expectWidth, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), expectHeight, TEST_LOCATION);
+
+  renderTargetTexture = frameBuffer.GetColorTexture();
+  DALI_TEST_CHECK(renderTargetTexture);
+
+  DALI_TEST_EQUALS(renderTargetTexture.GetWidth(), expectWidth, TEST_LOCATION);
+  DALI_TEST_EQUALS(renderTargetTexture.GetHeight(), expectHeight, TEST_LOCATION);
+
+  tet_printf("Test Framebuffer result target created well after change resolution\n");
+  expectWidth  = 421u;
+  expectHeight = 103u;
+  view.SetResolution(expectWidth, expectHeight);
+
+  renderTask = renderTaskList.GetTask(baseRenderTaskCount);
+  DALI_TEST_CHECK(renderTask);
+
+  frameBuffer = renderTask.GetFrameBuffer();
+  DALI_TEST_CHECK(frameBuffer);
+
+  DALI_TEST_EQUALS(view.GetResolutionWidth(), expectWidth, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetResolutionHeight(), expectHeight, TEST_LOCATION);
+
+  renderTargetTexture = frameBuffer.GetColorTexture();
+  DALI_TEST_CHECK(renderTargetTexture);
+
+  DALI_TEST_EQUALS(renderTargetTexture.GetWidth(), expectWidth, TEST_LOCATION);
+  DALI_TEST_EQUALS(renderTargetTexture.GetHeight(), expectHeight, TEST_LOCATION);
+
+  END_TEST;
+}
+
+namespace
+{
+const char* TEST_MASK_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/mask.png";
+
+static constexpr std::string_view Y_FLIP_MASK_TEXTURE = "uYFlipMaskTexture";
+} // namespace
+
+int UtcDaliSceneViewMasking(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  application.GetScene().Add(view);
+
+  DALI_TEST_EQUALS(view.GetProperty<std::string>(Dali::Scene3D::SceneView::Property::ALPHA_MASK_URL), "", TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetProperty<bool>(Dali::Scene3D::SceneView::Property::CROP_TO_MASK), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetProperty<float>(Dali::Scene3D::SceneView::Property::MASK_CONTENT_SCALE), 1.0f, TEST_LOCATION);
+
+  auto yFlipMaskTextureIndex = view.GetPropertyIndex(Y_FLIP_MASK_TEXTURE.data());
+  DALI_TEST_EQUALS(yFlipMaskTextureIndex, Property::INVALID_INDEX, TEST_LOCATION);
+
+  view.UseFramebuffer(true);
+  view.SetProperty(Dali::Scene3D::SceneView::Property::ALPHA_MASK_URL, TEST_MASK_IMAGE_FILE_NAME);
+  view.SetProperty(Dali::Scene3D::SceneView::Property::CROP_TO_MASK, false);
+  view.SetProperty(Dali::Scene3D::SceneView::Property::MASK_CONTENT_SCALE, 0.5f);
+
+  DALI_TEST_EQUALS(view.GetProperty<std::string>(Dali::Scene3D::SceneView::Property::ALPHA_MASK_URL), TEST_MASK_IMAGE_FILE_NAME, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetProperty<bool>(Dali::Scene3D::SceneView::Property::CROP_TO_MASK), false, TEST_LOCATION);
+  DALI_TEST_EQUALS(view.GetProperty<float>(Dali::Scene3D::SceneView::Property::MASK_CONTENT_SCALE), 0.5f, TEST_LOCATION);
+
+  yFlipMaskTextureIndex = view.GetPropertyIndex(std::string(Y_FLIP_MASK_TEXTURE));
+  DALI_TEST_EQUALS(view.GetProperty<float>(yFlipMaskTextureIndex), 1.0f, TEST_LOCATION);
+
+  END_TEST;
+}