Dali::Integration::Scene scene = application.GetScene();
- Actor actor = Actor::New();
- DALI_TEST_CHECK(Dali::Integration::Scene() == Dali::Integration::Scene::Get(actor));
+ Actor parent = Actor::New();
+ Actor child = Actor::New();
- scene.Add(actor);
+ parent.Add(child);
+
+ // Should be empty scene
+ DALI_TEST_CHECK(Dali::Integration::Scene() == Dali::Integration::Scene::Get(parent));
+ DALI_TEST_CHECK(Dali::Integration::Scene() == Dali::Integration::Scene::Get(child));
+
+ scene.Add(parent);
- DALI_TEST_CHECK(scene == Dali::Integration::Scene::Get(actor));
+ // Should return the valid scene
+ DALI_TEST_CHECK(scene == Dali::Integration::Scene::Get(parent));
+ DALI_TEST_CHECK(scene == Dali::Integration::Scene::Get(child));
+
+ parent.Unparent();
+
+ // Should be empty scene
+ DALI_TEST_CHECK(Dali::Integration::Scene() == Dali::Integration::Scene::Get(parent));
+ DALI_TEST_CHECK(Dali::Integration::Scene() == Dali::Integration::Scene::Get(child));
END_TEST;
}
DALI_TEST_CHECK(event2.delta == data.receivedWheelEvent.GetDelta());
DALI_TEST_CHECK(event2.timeStamp == data.receivedWheelEvent.GetTime());
END_TEST;
-}
\ No newline at end of file
+}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
{
// need to change state first so that internals relying on IsOnScene() inside OnSceneDisconnectionInternal() get the correct value
mOwner.mIsOnScene = false;
+ mOwner.mScene = nullptr;
// Recursively disconnect children
if(mChildren)