Integration::HoverEvent hoverEvent;
Integration::Point point = GeneratePoint(1, PointState::INTERRUPTED, 100.0f, 100.0f);
- DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_BOTH, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
+ DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
DALI_TEST_EQUALS(touchEvent.GetPointCount(), 1u, TEST_LOCATION);
DALI_TEST_EQUALS(touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION);
+ }
+
+ // Send up, should not be able to send as combiner has been reset.
+ // Up event
+ {
+ Integration::TouchEvent touchEvent;
+ Integration::HoverEvent hoverEvent;
+ Integration::Point point = GeneratePoint(1, PointState::UP, 100.0f, 100.0f);
+
+ DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
+ }
+
+ // motion event for hover
+ {
+ Integration::TouchEvent touchEvent;
+ Integration::HoverEvent hoverEvent;
+ Integration::Point point = GeneratePoint(1, PointState::MOTION, 100.0f, 100.0f);
+ point.SetDeviceClass(Device::Class::Type::MOUSE);
+
+ DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
+ DALI_TEST_EQUALS(hoverEvent.GetPointCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(hoverEvent.points[0].GetDeviceId(), point.GetDeviceId(), TEST_LOCATION);
+ DALI_TEST_EQUALS(hoverEvent.points[0].GetState(), PointState::STARTED, TEST_LOCATION);
+ DALI_TEST_EQUALS(hoverEvent.points[0].GetScreenPosition(), point.GetScreenPosition(), TEST_LOCATION);
+ }
+
+ time++;
+
+ // Interrupted event
+ {
+ Integration::TouchEvent touchEvent;
+ Integration::HoverEvent hoverEvent;
+ Integration::Point point = GeneratePoint(1, PointState::INTERRUPTED, 100.0f, 100.0f);
+ point.SetDeviceClass(Device::Class::Type::MOUSE);
+
+ DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
DALI_TEST_EQUALS(hoverEvent.GetPointCount(), 1u, TEST_LOCATION);
DALI_TEST_EQUALS(hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION);
}
Integration::HoverEvent hoverEvent;
Integration::Point point = GeneratePoint(1, PointState::INTERRUPTED, 100.0f, 100.0f);
- DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_BOTH, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
+ DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_TOUCH, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
DALI_TEST_EQUALS(touchEvent.GetPointCount(), 1u, TEST_LOCATION);
DALI_TEST_EQUALS(touchEvent.points[0].GetState(), point.GetState(), TEST_LOCATION);
+ }
+
+ // Send up, should not be able to send as combiner has been reset.
+ // Up event
+ {
+ Integration::TouchEvent touchEvent;
+ Integration::HoverEvent hoverEvent;
+ Integration::Point point = GeneratePoint(1, PointState::UP, 100.0f, 100.0f);
+
+ DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_NONE, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
+ }
+
+ // Several motion for hover
+ for(unsigned int pointCount = 1u; pointCount < maximum; ++pointCount)
+ {
+ Integration::TouchEvent touchEvent;
+ Integration::HoverEvent hoverEvent;
+ Integration::Point point = GeneratePoint(pointCount, PointState::MOTION, 100.0f, 100.0f);
+ point.SetDeviceClass(Device::Class::Type::MOUSE);
+
+ DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
+ DALI_TEST_EQUALS(hoverEvent.GetPointCount(), pointCount, TEST_LOCATION);
+ }
+
+ // Interrupted event
+ {
+ Integration::TouchEvent touchEvent;
+ Integration::HoverEvent hoverEvent;
+ Integration::Point point = GeneratePoint(1, PointState::INTERRUPTED, 100.0f, 100.0f);
+ point.SetDeviceClass(Device::Class::Type::MOUSE);
+
+ DALI_TEST_EQUALS(Integration::TouchEventCombiner::DISPATCH_HOVER, combiner.GetNextTouchEvent(point, time, touchEvent, hoverEvent), TEST_LOCATION);
DALI_TEST_EQUALS(hoverEvent.GetPointCount(), 1u, TEST_LOCATION);
DALI_TEST_EQUALS(hoverEvent.points[0].GetState(), point.GetState(), TEST_LOCATION);
}