Merge branch 'devel/master' into devel/new_mesh
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Actor.cpp
index 2ec0ab1..44a83f3 100644 (file)
@@ -42,7 +42,6 @@ void utc_dali_actor_cleanup(void)
 namespace
 {
 bool gTouchCallBackCalled=false;
-bool gTouchCallBack2Called=false;
 bool gHoverCallBackCalled=false;
 
 /**
@@ -57,7 +56,6 @@ int SimulateTouchForSetOverlayHitTest(TestApplication& app)
   app.Render(1);
 
   gTouchCallBackCalled = false;
-  gTouchCallBack2Called = false;
 
   // simulate a touch event
   Dali::TouchPoint point( 0, TouchPoint::Down, 25.0f, 25.0f );
@@ -113,13 +111,6 @@ static bool TestCallback(Actor actor, const TouchEvent& event)
   END_TEST;
 }
 
-static bool TestCallback2(Actor actor, const TouchEvent& event)
-{
-  gTouchCallBack2Called = true;
-  return false;
-  END_TEST;
-}
-
 static bool TestCallback3(Actor actor, const HoverEvent& event)
 {
   gHoverCallBackCalled = true;
@@ -2318,89 +2309,6 @@ int UtcDaliActorSetDrawModeOverlayRender(void)
   END_TEST;
 }
 
-
-int UtcDaliActorSetDrawModeOverlayHitTest(void)
-{
-  TestApplication app;
-  tet_infoline(" UtcDaliActorSetDrawModeOverlayHitTest");
-
-  BufferImage imageA = BufferImage::New(16, 16);
-  BufferImage imageB = BufferImage::New(16, 16);
-  ImageActor a = ImageActor::New( imageA );
-  ImageActor b = ImageActor::New( imageB );
-
-  // Render a,b as regular non-overlays. so order will be:
-  Stage::GetCurrent().Add(a);
-  Stage::GetCurrent().Add(b);
-
-  a.SetSize( 100.0f, 100.0f );
-  b.SetSize( 100.0f, 100.0f );
-
-  // position b overlapping a. (regular non-overlays)
-  // hit test at point 'x'
-  // --------
-  // |      |
-  // | a    |
-  // |   --------
-  // |   |x     |
-  // |   |      |
-  // ----|      |
-  //     |   b  |
-  //     |      |
-  //     --------
-  // note: b is on top, because it's Z position is higher.
-  a.SetPosition(Vector3(0.0f, 0.0f, 0.0f));
-  b.SetPosition(Vector3(50.0f, 50.0f, 1.0f));
-
-  // connect to their touch signals
-  a.TouchedSignal().Connect(TestCallback);
-  b.TouchedSignal().Connect(TestCallback2);
-
-  a.SetDrawMode( DrawMode::NORMAL );
-  b.SetDrawMode( DrawMode::NORMAL );
-  SimulateTouchForSetOverlayHitTest(app);
-
-  DALI_TEST_CHECK( gTouchCallBackCalled == false );
-  DALI_TEST_CHECK( gTouchCallBack2Called == true );
-  // Make Actor a an overlay.
-  // --------
-  // |      |
-  // | a    |
-  // |      |----
-  // |    x |   |
-  // |      |   |
-  // --------   |
-  //     |   b  |
-  //     |      |
-  //     --------
-  // note: a is on top, because it is an overlay.
-  a.SetDrawMode( DrawMode::OVERLAY );
-  b.SetDrawMode( DrawMode::NORMAL );
-  SimulateTouchForSetOverlayHitTest(app);
-
-  DALI_TEST_CHECK( gTouchCallBackCalled == true );
-  DALI_TEST_CHECK( gTouchCallBack2Called == false );
-  // Make both Actors as overlays
-  // --------
-  // |      |
-  // | a    |
-  // |   --------
-  // |   |x     |
-  // |   |      |
-  // ----|      |
-  //     |   b  |
-  //     |      |
-  //     --------
-  // note: b is on top, because it is the 2nd child in the hierarchy.
-  a.SetDrawMode( DrawMode::OVERLAY );
-  b.SetDrawMode( DrawMode::OVERLAY );
-  SimulateTouchForSetOverlayHitTest(app);
-
-  DALI_TEST_CHECK( gTouchCallBackCalled == false );
-  DALI_TEST_CHECK( gTouchCallBack2Called == true );
-  END_TEST;
-}
-
 int UtcDaliActorGetCurrentWorldMatrix(void)
 {
   TestApplication app;
@@ -2686,8 +2594,8 @@ int UtcDaliRelayoutProperties_ResizePolicies(void)
   Actor actor = Actor::New();
 
   // Defaults
-  DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_RESIZE_POLICY ).Get< std::string >(), "FIXED", TEST_LOCATION );
-  DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_RESIZE_POLICY ).Get< std::string >(), "FIXED", TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::WIDTH_RESIZE_POLICY ).Get< std::string >(), "USE_NATURAL_SIZE", TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::HEIGHT_RESIZE_POLICY ).Get< std::string >(), "USE_NATURAL_SIZE", TEST_LOCATION );
 
   // Set resize policy for all dimensions
   actor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
@@ -2831,7 +2739,7 @@ int UtcDaliActorGetHeightForWidth(void)
 
   Actor actor = Actor::New();
 
-  DALI_TEST_EQUALS( actor.GetHeightForWidth( 1.0f ), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetHeightForWidth( 1.0f ), 1.0f, TEST_LOCATION );
 
   END_TEST;
 }
@@ -2842,7 +2750,7 @@ int UtcDaliActorGetWidthForHeight(void)
 
   Actor actor = Actor::New();
 
-  DALI_TEST_EQUALS( actor.GetWidthForHeight( 1.0f ), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetWidthForHeight( 1.0f ), 1.0f, TEST_LOCATION );
 
   END_TEST;
 }