+int UtcDaliSceneEnsureRenderTargetRecreated(void)
+{
+ tet_infoline("Ensure render target is re-created when surface replaced ");
+
+ TestApplication application;
+
+ // Create a new scene and set the background color of the main scene
+ auto defaultScene = application.GetScene();
+ defaultScene.SetBackgroundColor(Color::BLUE);
+
+ auto actor = CreateRenderableActor();
+ defaultScene.Add(actor);
+
+ auto& graphicsController = application.GetGraphicsController();
+
+ application.SendNotification();
+ application.Render();
+
+ TraceCallStack& graphicsCallStack = graphicsController.mCallStack;
+ TraceCallStack::NamedParams empty{};
+ const TraceCallStack::NamedParams* matching = graphicsCallStack.FindLastMatch("PresentRenderTarget", empty);
+ DALI_TEST_CHECK(matching != nullptr);
+
+ graphicsCallStack.Reset();
+
+ int fakeSurface1;
+ Graphics::RenderTargetCreateInfo createInfo{};
+ createInfo.SetSurface(&fakeSurface1).SetExtent(Graphics::Extent2D{480u, 800u});
+ defaultScene.SetSurfaceRenderTarget(createInfo);
+
+ application.SendNotification();
+ application.Render();
+
+ TraceCallStack::NamedParams query1;
+ query1["surface"] << std::hex << &fakeSurface1;
+ const TraceCallStack::NamedParams* matching2 = graphicsCallStack.FindLastMatch("CreateRenderTarget", query1);
+ DALI_TEST_CHECK(matching2 != nullptr);
+
+ const TraceCallStack::NamedParams* matching3 = graphicsCallStack.FindLastMatch("PresentRenderTarget", empty);
+ DALI_TEST_CHECK(matching3 != nullptr);
+ DALI_TEST_EQUALS((*matching3)["surface"].str(), query1["surface"].str(), TEST_LOCATION);
+
+ END_TEST;
+}
+