[dali_2.3.28] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-scene3d / utc-Dali-SceneView.cpp
index ca87d38..4541eee 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2023 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.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 #include <dali-toolkit-test-suite-utils.h>
  */
 
 #include <dali-toolkit-test-suite-utils.h>
+#include <toolkit-event-thread-callback.h>
+#include <toolkit-timer.h>
+
 #include <dali-toolkit/dali-toolkit.h>
 #include <stdlib.h>
 #include <iostream>
 
 #include <dali-scene3d/public-api/controls/model/model.h>
 #include <dali-scene3d/public-api/controls/scene-view/scene-view.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <stdlib.h>
 #include <iostream>
 
 #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;
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -51,7 +54,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
  *
  * These textures are based off version of Wave engine sample
  * Take from https://github.com/WaveEngine/Samples
  *
- * Copyright (c) 2023 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
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -313,13 +316,12 @@ int UtcDaliSceneViewOnScene02(void)
 {
   ToolkitTestApplication application;
 
 {
   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();
 
 
   Scene3D::SceneView view = Scene3D::SceneView::New();
 
-  renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
-  DALI_TEST_EQUALS(1u, renderTaskCount, TEST_LOCATION);
+  uint32_t renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
+  DALI_TEST_EQUALS(baseRenderTaskCount, renderTaskCount, TEST_LOCATION);
 
   application.GetScene().Add(view);
 
 
   application.GetScene().Add(view);
 
@@ -327,9 +329,9 @@ int UtcDaliSceneViewOnScene02(void)
   application.Render();
 
   renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
   application.Render();
 
   renderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
-  DALI_TEST_EQUALS(3u, renderTaskCount, TEST_LOCATION);
+  DALI_TEST_EQUALS(baseRenderTaskCount + 1u, renderTaskCount, TEST_LOCATION);
 
 
-  RenderTask  renderTask = application.GetScene().GetRenderTaskList().GetTask(2u);
+  RenderTask  renderTask = application.GetScene().GetRenderTaskList().GetTask(baseRenderTaskCount);
   CameraActor camera     = renderTask.GetCameraActor();
 
   CameraActor defaultCamera = renderTask.GetCameraActor();
   CameraActor camera     = renderTask.GetCameraActor();
 
   CameraActor defaultCamera = renderTask.GetCameraActor();
@@ -685,6 +687,8 @@ int UtcDaliSceneViewUseFramebuffer02(void)
 {
   ToolkitTestApplication application;
 
 {
   ToolkitTestApplication application;
 
+  uint32_t baseRenderTaskCount = application.GetScene().GetRenderTaskList().GetTaskCount();
+
   Scene3D::SceneView view = Scene3D::SceneView::New();
   view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
 
   Scene3D::SceneView view = Scene3D::SceneView::New();
   view.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100));
 
@@ -693,7 +697,7 @@ int UtcDaliSceneViewUseFramebuffer02(void)
   application.SendNotification();
   application.Render();
 
   application.SendNotification();
   application.Render();
 
-  RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(2u);
+  RenderTask renderTask = application.GetScene().GetRenderTaskList().GetTask(baseRenderTaskCount);
   DALI_TEST_CHECK(!renderTask.GetFrameBuffer());
 
   view.UseFramebuffer(true);
   DALI_TEST_CHECK(!renderTask.GetFrameBuffer());
 
   view.UseFramebuffer(true);
@@ -996,20 +1000,20 @@ int UtcDaliSceneViewCreateAndRemoveRenderTask(void)
   ToolkitTestApplication application;
   RenderTaskList         taskList = application.GetScene().GetRenderTaskList();
 
   ToolkitTestApplication application;
   RenderTaskList         taskList = application.GetScene().GetRenderTaskList();
 
-  uint32_t renderTaskCount = taskList.GetTaskCount();
+  uint32_t baseRenderTaskCount = taskList.GetTaskCount();
 
   Scene3D::SceneView view = Scene3D::SceneView::New();
   view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
 
 
   Scene3D::SceneView view = Scene3D::SceneView::New();
   view.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
 
-  DALI_TEST_EQUALS(renderTaskCount, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
+  DALI_TEST_EQUALS(baseRenderTaskCount, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
 
   application.GetScene().Add(view);
 
 
   application.GetScene().Add(view);
 
-  DALI_TEST_EQUALS(renderTaskCount + 2, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
+  DALI_TEST_EQUALS(baseRenderTaskCount + 1, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
 
   view.Unparent();
 
 
   view.Unparent();
 
-  DALI_TEST_EQUALS(renderTaskCount, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
+  DALI_TEST_EQUALS(baseRenderTaskCount, application.GetScene().GetRenderTaskList().GetTaskCount(), TEST_LOCATION);
 
   END_TEST;
 }
 
   END_TEST;
 }
@@ -1033,3 +1037,457 @@ int UtcDaliSceneViewColorMode(void)
 
   END_TEST;
 }
 
   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;
+}
+
+namespace
+{
+static bool                                   gCaptureFinishedCalled{false};
+static int32_t                                gCaptureId{-1};
+static Toolkit::ImageUrl                      gCapturedImageUrl;
+static Scene3D::SceneView::CaptureFinishState gCaptureFinishState{Scene3D::SceneView::CaptureFinishState::FAILED};
+
+void OnCaptureFinished(Scene3D::SceneView sceneView, Scene3D::SceneView::CaptureResult& captureResult)
+{
+  gCaptureFinishedCalled = true;
+  gCaptureId             = captureResult.captureId;
+  gCapturedImageUrl      = captureResult.imageUrl;
+  gCaptureFinishState    = captureResult.state;
+}
+
+static int32_t                                             gCapturedCount{0};
+static std::vector<int32_t>                                gCaptureIds;
+static std::vector<Toolkit::ImageUrl>                      gCapturedImageUrls;
+static std::vector<Scene3D::SceneView::CaptureFinishState> gCaptureFinishStates;
+
+void OnCaptureMultipleFinished(Scene3D::SceneView sceneView, Scene3D::SceneView::CaptureResult& captureResult)
+{
+  gCapturedCount++;
+  gCaptureIds.push_back(captureResult.captureId);
+  gCapturedImageUrls.push_back(captureResult.imageUrl);
+  gCaptureFinishStates.push_back(captureResult.state);
+}
+} // namespace
+
+int UtcDaliSceneViewCapture01(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.CaptureFinishedSignal().Connect(OnCaptureFinished);
+  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);
+  view.Add(modelView1);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  CameraActor camera = Dali::CameraActor::New();
+  camera.SetProperty(Dali::Actor::Property::NAME, "camera");
+  camera.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  camera.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  camera.SetFieldOfView(0.5f);
+  camera.SetNearClippingPlane(1.0f);
+  camera.SetFarClippingPlane(5000.0f);
+  camera.SetProperty(Dali::Actor::Property::POSITION, Vector3(20, 30, 40));
+
+  view.Add(camera);
+
+  gCaptureFinishedCalled = false;
+  gCaptureId = -1;
+  gCapturedImageUrl.Reset();
+  gCaptureFinishState = Scene3D::SceneView::CaptureFinishState::FAILED;
+  int32_t captureId = view.Capture(camera, Vector2(300, 300));
+
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_EQUALS(gCaptureFinishedCalled, true, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureId, captureId, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCapturedImageUrl.GetUrl().empty(), false, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureFinishState, Scene3D::SceneView::CaptureFinishState::SUCCEEDED, TEST_LOCATION);
+
+  Toolkit::ImageUrl tempImageUrl = gCapturedImageUrl;
+
+  gCaptureFinishedCalled = false;
+  gCaptureId = -1;
+  gCapturedImageUrl.Reset();
+  gCaptureFinishState = Scene3D::SceneView::CaptureFinishState::FAILED;
+  int32_t captureId2 = view.Capture(camera, Vector2(400, 400));
+
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_EQUALS(gCaptureFinishedCalled, true, TEST_LOCATION);
+  DALI_TEST_NOT_EQUALS(captureId, captureId2, 0.1f, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureId, captureId2, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCapturedImageUrl.GetUrl().empty(), false, TEST_LOCATION);
+  DALI_TEST_NOT_EQUALS(gCapturedImageUrl, tempImageUrl, 0.1f, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureFinishState, Scene3D::SceneView::CaptureFinishState::SUCCEEDED, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewCaptureCancel(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.CaptureFinishedSignal().Connect(OnCaptureFinished);
+  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);
+  view.Add(modelView1);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  CameraActor camera = Dali::CameraActor::New();
+  camera.SetProperty(Dali::Actor::Property::NAME, "camera");
+  camera.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  camera.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  camera.SetFieldOfView(0.5f);
+  camera.SetNearClippingPlane(1.0f);
+  camera.SetFarClippingPlane(5000.0f);
+  camera.SetProperty(Dali::Actor::Property::POSITION, Vector3(20, 30, 40));
+
+  view.Add(camera);
+
+  gCaptureFinishedCalled = false;
+  gCaptureId = -1;
+  gCapturedImageUrl.Reset();
+  gCaptureFinishState = Scene3D::SceneView::CaptureFinishState::FAILED;
+  int32_t captureId = view.Capture(camera, Vector2(300, 300));
+
+  view.Unparent();
+
+  DALI_TEST_EQUALS(gCaptureFinishedCalled, true, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureId, captureId, TEST_LOCATION);
+  DALI_TEST_EQUALS(!!gCapturedImageUrl, false, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureFinishState, Scene3D::SceneView::CaptureFinishState::FAILED, TEST_LOCATION);
+
+
+  gCaptureFinishedCalled = false;
+  gCaptureId = -1;
+  gCapturedImageUrl.Reset();
+  gCaptureFinishState = Scene3D::SceneView::CaptureFinishState::FAILED;
+
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_EQUALS(gCaptureFinishedCalled, false, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewCaptureFailed(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.CaptureFinishedSignal().Connect(OnCaptureFinished);
+  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);
+  view.Add(modelView1);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  CameraActor camera = Dali::CameraActor::New();
+  camera.SetProperty(Dali::Actor::Property::NAME, "camera");
+  camera.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  camera.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  camera.SetFieldOfView(0.5f);
+  camera.SetNearClippingPlane(1.0f);
+  camera.SetFarClippingPlane(5000.0f);
+  camera.SetProperty(Dali::Actor::Property::POSITION, Vector3(20, 30, 40));
+
+  view.Add(camera);
+
+  gCaptureFinishedCalled = false;
+  gCaptureId = -1;
+  gCapturedImageUrl.Reset();
+  gCaptureFinishState = Scene3D::SceneView::CaptureFinishState::FAILED;
+  int32_t captureId = view.Capture(camera, Vector2(300, 300));
+
+  Test::EmitGlobalTimerSignal();
+  Test::EmitGlobalTimerSignal();
+  Test::EmitGlobalTimerSignal();
+
+  DALI_TEST_EQUALS(gCaptureFinishedCalled, true, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureId, captureId, TEST_LOCATION);
+  DALI_TEST_EQUALS(!!gCapturedImageUrl, false, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureFinishState, Scene3D::SceneView::CaptureFinishState::FAILED, TEST_LOCATION);
+
+  gCaptureFinishedCalled = false;
+  gCaptureId = -1;
+  gCapturedImageUrl.Reset();
+  gCaptureFinishState = Scene3D::SceneView::CaptureFinishState::FAILED;
+
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_EQUALS(gCaptureFinishedCalled, false, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneViewCapture02(void)
+{
+  ToolkitTestApplication application;
+
+  Scene3D::SceneView view = Scene3D::SceneView::New();
+  view.CaptureFinishedSignal().Connect(OnCaptureMultipleFinished);
+  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);
+  view.Add(modelView1);
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  application.SendNotification();
+  application.Render();
+
+  CameraActor camera = Dali::CameraActor::New();
+  camera.SetProperty(Dali::Actor::Property::NAME, "camera");
+  camera.SetProperty(Dali::Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  camera.SetProperty(Dali::Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  camera.SetFieldOfView(0.5f);
+  camera.SetNearClippingPlane(1.0f);
+  camera.SetFarClippingPlane(5000.0f);
+  camera.SetProperty(Dali::Actor::Property::POSITION, Vector3(20, 30, 40));
+
+  view.Add(camera);
+
+  gCapturedCount = 0;
+  gCaptureIds.clear();
+  gCapturedImageUrls.clear();
+  gCaptureFinishStates.clear();
+  int32_t captureId = view.Capture(camera, Vector2(300, 300));
+  int32_t captureId2 = view.Capture(camera, Vector2(300, 300));
+
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+
+  DALI_TEST_EQUALS(gCapturedCount, 2, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureIds.size(), 2, TEST_LOCATION);
+  auto idIter1 = std::find(gCaptureIds.begin(), gCaptureIds.end(), captureId);
+  bool isIter1 = idIter1 != gCaptureIds.end();
+  DALI_TEST_EQUALS(isIter1, true, TEST_LOCATION);
+  auto idIter2 = std::find(gCaptureIds.begin(), gCaptureIds.end(), captureId2);
+  bool isIter2 = idIter2 != gCaptureIds.end();
+  DALI_TEST_EQUALS(isIter2, true, TEST_LOCATION);
+
+  DALI_TEST_EQUALS(gCapturedImageUrls.size(), 2, TEST_LOCATION);
+  DALI_TEST_NOT_EQUALS(gCapturedImageUrls[0], gCapturedImageUrls[1], 0.1f, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureFinishStates[0], Scene3D::SceneView::CaptureFinishState::SUCCEEDED, TEST_LOCATION);
+  DALI_TEST_EQUALS(gCaptureFinishStates[1], Scene3D::SceneView::CaptureFinishState::SUCCEEDED, TEST_LOCATION);
+
+  END_TEST;
+}
\ No newline at end of file