END_TEST;
}
+int UtcDaliSceneGet(void)
+{
+ TestApplication application;
+ tet_infoline("Testing Dali::Integration::Scene::Get");
+
+ Dali::Integration::Scene scene = application.GetScene();
+
+ Actor actor = Actor::New();
+ DALI_TEST_CHECK( Dali::Integration::Scene() == Dali::Integration::Scene::Get( actor ) );
+
+ scene.Add( actor );
+
+ DALI_TEST_CHECK( scene == Dali::Integration::Scene::Get( actor ) );
+
+ END_TEST;
+}
+
+int UtcDaliSceneDiscard(void)
+{
+ TestApplication application;
+ tet_infoline("Testing Dali::Scene::Discard");
+
+ // Create a new Scene
+ Dali::Integration::Scene scene = Dali::Integration::Scene::New( Vector2( 480.0f, 800.0f ) );
+ DALI_TEST_CHECK( scene );
+
+ // One reference of scene kept here and the other one kept in the Core
+ DALI_TEST_CHECK( scene.GetBaseObject().ReferenceCount() == 2 );
+
+ // Render and notify.
+ application.SendNotification();
+ application.Render(0);
+
+ // Keep the reference of the root layer handle so it will still be alive after the scene is deleted
+ Layer rootLayer = scene.GetRootLayer();
+ DALI_TEST_CHECK( rootLayer );
+ DALI_TEST_CHECK( rootLayer.GetBaseObject().ReferenceCount() == 2 );
+
+ // Request to discard the scene from the Core
+ scene.Discard();
+ DALI_TEST_CHECK( scene.GetBaseObject().ReferenceCount() == 1 );
+
+ // Reset the scene handle
+ scene.Reset();
+
+ // Render and notify.
+ application.SendNotification();
+ application.Render(0);
+
+ // At this point, the scene should have been automatically deleted
+ // To prove this, the ref count of the root layer handle should be decremented to 1
+ DALI_TEST_CHECK( rootLayer.GetBaseObject().ReferenceCount() == 1 );
+
+ // Delete the root layer handle
+ rootLayer.Reset();
+
+ // Render and notify.
+ application.SendNotification();
+ application.Render(0);
+
+ END_TEST;
+}
+
int UtcDaliSceneEventProcessingFinishedP(void)
{
TestApplication application;