+ DALI_TEST_EQUALS(testBox.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(testBox.y, (int)(scene.GetSize().height - glScissorParams.y - testBox.height), TEST_LOCATION); // GL Coordinates are from bottom left
+ DALI_TEST_EQUALS(testBox.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(testBox.height, glScissorParams.height, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliLayerBehaviour(void)
+{
+ TestApplication application;
+ Layer layer = Layer::New();
+
+ DALI_TEST_EQUALS(layer.GetProperty<Layer::Behavior>(Layer::Property::BEHAVIOR), Dali::Layer::LAYER_UI, TEST_LOCATION);
+ layer.SetProperty(Layer::Property::BEHAVIOR, Dali::Layer::LAYER_3D);
+ DALI_TEST_EQUALS(layer.GetProperty<Layer::Behavior>(Layer::Property::BEHAVIOR), Dali::Layer::LAYER_3D, TEST_LOCATION);
+ END_TEST;
+}
+
+Actor CreateActor(bool withAlpha)
+{
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, withAlpha ? Pixel::Format::RGBA8888 : Pixel::Format::RGB888, 1u, 1u);
+
+ Actor actor = CreateRenderableActor(texture);
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+
+ return actor;
+}
+
+int UtcDaliLayer3DSort(void)
+{
+ tet_infoline("Testing LAYER_3D sort coverage test");
+ TestApplication application;
+ TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+ TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace();
+
+ application.GetScene().GetRootLayer().SetProperty(Layer::Property::BEHAVIOR, Layer::LAYER_3D);
+
+ // Create an actor.
+ Actor actor = CreateActor(false);
+ application.GetScene().Add(actor);
+
+ // Create child actors.
+ Actor child1 = CreateActor(true);
+ actor.Add(child1);
+ Actor child2 = CreateActor(false);
+ child1.Add(child2);
+
+ enabledDisableTrace.Reset();
+ enabledDisableTrace.Enable(true);
+ application.SendNotification();
+ application.Render();
+ enabledDisableTrace.Enable(false);
+
+ std::ostringstream depth;
+ depth << std::hex << GL_DEPTH_TEST;
+ DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", depth.str()));
+
+ END_TEST;
+}
+
+int UtcDaliLayerLowerBelowNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ Dali::Layer arg1;
+ instance.LowerBelow(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliLayerRaiseAboveNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ Dali::Layer arg1;
+ instance.RaiseAbove(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliLayerRaiseToTopNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ instance.RaiseToTop();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliLayerLowerToBottomNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ instance.LowerToBottom();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliLayerSetSortFunctionNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ Layer::SortFunctionType function = nullptr;
+ instance.SetSortFunction(function);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliLayerLowerNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ instance.Lower();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliLayerRaiseNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ instance.Raise();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliLayerMoveAboveNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ Dali::Layer arg1;
+ instance.MoveAbove(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliLayerMoveBelowNegative(void)
+{
+ TestApplication application;
+ Dali::Layer instance;
+ try
+ {
+ Dali::Layer arg1;
+ instance.MoveBelow(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }