+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( pushButton.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliButtonEventConsumption(void)
+{
+ /**
+ * [ Parent ]
+ * [ Child ]
+ *
+ * Child parented and positioned under parent.
+ * Touch up and down performed on child.
+ * Should only trigger signal on child.
+ */
+
+ ToolkitTestApplication application;
+
+ Button parentButton = PushButton::New();
+ parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
+ application.GetScene().Add( parentButton );
+
+ Button childButton = PushButton::New();
+ childButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ childButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
+ childButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
+ parentButton.Add( childButton );
+
+ // Reset signal flags
+ gIsCalledChildButtonCallback = false;
+ gIsCalledButtonCallback = false;
+
+ parentButton.ClickedSignal().Connect( &ButtonCallback );
+ childButton.ClickedSignal().Connect( &ChildButtonCallback );
+
+ // Peform a button click at coordinates (10,30) which is the child.
+ Dali::Integration::TouchEvent event;
+ event = Dali::Integration::TouchEvent();
+ Dali::Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 10, 30 ) );
+ event.AddPoint( point );
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+ application.ProcessEvent( event );
+
+ event = Dali::Integration::TouchEvent();
+ point.SetState( PointState::UP );
+ point.SetScreenPosition( Vector2( 10, 30 ) );
+ event.AddPoint( point );
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+ application.ProcessEvent( event );
+
+ DALI_TEST_EQUALS( gIsCalledChildButtonCallback, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( ! gIsCalledButtonCallback, true, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliButtonRelease(void)
+{
+ /**
+ * Down event followed by interrupted event should signal Release.
+ */
+
+ ToolkitTestApplication application;
+
+ Button parentButton = PushButton::New();
+ parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
+ application.GetScene().Add( parentButton );
+ parentButton.ReleasedSignal().Connect( &ButtonCallback );
+
+ // Reset signal flags
+ gIsCalledButtonCallback = false;
+
+ // Peform a button down and then button interrupted at coordinates (10,10).
+ Dali::Integration::TouchEvent event;
+ event = Dali::Integration::TouchEvent();
+ Dali::Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 10, 10 ) );
+ event.AddPoint( point );
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+ application.ProcessEvent( event );
+
+ event = Dali::Integration::TouchEvent();
+ point.SetState( PointState::INTERRUPTED );
+ event.AddPoint( point );
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+ application.ProcessEvent( event );
+
+ DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+