Modified: trunk/LayoutTests/ChangeLog (129436 => 129437)
--- trunk/LayoutTests/ChangeLog 2012-09-25 00:53:09 UTC (rev 129436)
+++ trunk/LayoutTests/ChangeLog 2012-09-25 00:54:11 UTC (rev 129437)
@@ -1,3 +1,14 @@
+2012-09-24 Nikhil Bansal <[email protected]>
+
+ [EFL][WK2] TestRunner needs touch events support.
+ https://bugs.webkit.org/show_bug.cgi?id=96465
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Touch events support added in WebKitTestRunner for layout tests.
+
+ * platform/efl-wk2/TestExpectations:
+
2012-09-24 Filip Pizlo <[email protected]>
ValueToInt32 bool case does bad things to registers
Modified: trunk/LayoutTests/platform/efl-wk2/TestExpectations (129436 => 129437)
--- trunk/LayoutTests/platform/efl-wk2/TestExpectations 2012-09-25 00:53:09 UTC (rev 129436)
+++ trunk/LayoutTests/platform/efl-wk2/TestExpectations 2012-09-25 00:54:11 UTC (rev 129437)
@@ -159,21 +159,8 @@
webkit.org/b/93470 fast/dom/title-directionality-removeChild.html [ Failure ]
webkit.org/b/93470 fast/dom/title-directionality.html [ Failure ]
-# WebKitTestRunner eventSender needs touch events support
-webkit.org/b/96465 fast/events/touch/basic-multi-touch-events-limited.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/basic-multi-touch-events.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/basic-single-touch-events.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/multi-touch-grouped-targets.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/send-oncancel-event.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/tap-highlight-color.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/touch-active-state.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/touch-coords-in-zoom-and-scroll.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/touch-inside-iframe.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/touch-inside-iframe-scrolled.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/touch-slider.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/touch-stale-node-crash.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/touch-target-limited.html [ Failure ]
-webkit.org/b/96465 fast/events/touch/touch-target.html [ Failure ]
+# WebKitTestRunner setTouchPointRadius() is not supported
+Bug(EFL) fast/events/touch/basic-single-touch-events.html [ Failure ]
# WebKitTestRunner needs an implementation for testRunner.setViewModeMediaFeature
Bug(EFL) fast/media/media-query-list-02.html [ Failure ]
Modified: trunk/Tools/ChangeLog (129436 => 129437)
--- trunk/Tools/ChangeLog 2012-09-25 00:53:09 UTC (rev 129436)
+++ trunk/Tools/ChangeLog 2012-09-25 00:54:11 UTC (rev 129437)
@@ -1,3 +1,33 @@
+2012-09-24 Nikhil Bansal <[email protected]>
+
+ [EFL][WK2] TestRunner needs touch events support.
+ https://bugs.webkit.org/show_bug.cgi?id=96465
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Simulate touch events in WebkitTestRunner for touch related
+ layout tests. This patch uses ewk_view_feed_touch_event() to
+ generate touch events.
+
+ * WebKitTestRunner/EventSenderProxy.h:
+ (EventSenderProxy):
+ * WebKitTestRunner/efl/EventSenderProxyEfl.cpp:
+ (WTR):
+ (WTR::setEvasModifiers):
+ (WTR::EventSenderProxy::EventSenderProxy):
+ (WTR::EventSenderProxy::~EventSenderProxy):
+ (WTR::EventSenderProxy::sendTouchEvent):
+ (WTR::EventSenderProxy::addTouchPoint):
+ (WTR::EventSenderProxy::updateTouchPoint):
+ (WTR::EventSenderProxy::setTouchModifier):
+ (WTR::EventSenderProxy::touchStart):
+ (WTR::EventSenderProxy::touchMove):
+ (WTR::EventSenderProxy::touchEnd):
+ (WTR::EventSenderProxy::touchCancel):
+ (WTR::EventSenderProxy::clearTouchPoints):
+ (WTR::EventSenderProxy::releaseTouchPoint):
+ (WTR::EventSenderProxy::cancelTouchPoint):
+
2012-09-24 Christophe Dumez <[email protected]>
[WK2] TestRunner does not support overridePreference with value "0"
Modified: trunk/Tools/WebKitTestRunner/EventSenderProxy.h (129436 => 129437)
--- trunk/Tools/WebKitTestRunner/EventSenderProxy.h 2012-09-25 00:53:09 UTC (rev 129436)
+++ trunk/Tools/WebKitTestRunner/EventSenderProxy.h 2012-09-25 00:54:11 UTC (rev 129437)
@@ -34,6 +34,7 @@
#include <gdk/gdk.h>
#include <wtf/Vector.h>
#elif PLATFORM(EFL)
+#include <WebKit2/EWebKit2.h>
#include <wtf/Deque.h>
#endif
@@ -50,6 +51,7 @@
class EventSenderProxy {
public:
explicit EventSenderProxy(TestController*);
+ ~EventSenderProxy();
void mouseDown(unsigned button, WKEventModifiers);
void mouseUp(unsigned button, WKEventModifiers);
@@ -97,7 +99,10 @@
#elif PLATFORM(EFL)
void sendOrQueueEvent(const WTREvent&);
void dispatchEvent(const WTREvent&);
+#if ENABLE(TOUCH_EVENTS)
+ void sendTouchEvent(Ewk_Touch_Event_Type);
#endif
+#endif
double m_time;
WKPoint m_position;
@@ -123,7 +128,10 @@
#elif PLATFORM(EFL)
Deque<WTREvent> m_eventQueue;
unsigned m_mouseButton;
+#if ENABLE(TOUCH_EVENTS)
+ Eina_List* m_touchPoints;
#endif
+#endif
};
} // namespace WTR
Modified: trunk/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp (129436 => 129437)
--- trunk/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp 2012-09-25 00:53:09 UTC (rev 129436)
+++ trunk/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp 2012-09-25 00:54:11 UTC (rev 129437)
@@ -45,6 +45,8 @@
namespace WTR {
+static const char* modifierNames[] = { "Shift", "Control", "Alt", "Meta" };
+
enum WTREventType {
WTREventTypeNone = 0,
WTREventTypeMouseDown,
@@ -133,7 +135,6 @@
static void setEvasModifiers(Evas* evas, WKEventModifiers wkModifiers)
{
- static const char* modifierNames[] = { "Shift", "Control", "Alt", "Meta" };
for (unsigned modifier = 0; modifier < (sizeof(modifierNames) / sizeof(char*)); ++modifier) {
if (wkModifiers & (1 << modifier))
evas_key_modifier_on(evas, modifierNames[modifier]);
@@ -293,9 +294,19 @@
, m_clickTime(0)
, m_clickButton(WTRMouseButtonNone)
, m_mouseButton(WTRMouseButtonNone)
+#if ENABLE(TOUCH_EVENTS)
+ , m_touchPoints(0)
+#endif
{
}
+EventSenderProxy::~EventSenderProxy()
+{
+#if ENABLE(TOUCH_EVENTS)
+ clearTouchPoints();
+#endif
+}
+
void EventSenderProxy::updateClickCountForButton(int button)
{
if (m_time - m_clickTime < 1 && m_position == m_clickPosition && button == m_clickButton) {
@@ -432,54 +443,117 @@
}
#if ENABLE(TOUCH_EVENTS)
+void EventSenderProxy::sendTouchEvent(Ewk_Touch_Event_Type eventType)
+{
+ ASSERT(m_touchPoints);
+
+ Evas_Object* ewkView = m_testController->mainWebView()->platformView();
+ ewk_view_feed_touch_event(ewkView, eventType, m_touchPoints, evas_key_modifier_get(evas_object_evas_get(ewkView)));
+
+ Eina_List* list;
+ Eina_List* listNext;
+ void* data;
+ EINA_LIST_FOREACH_SAFE(m_touchPoints, list, listNext, data) {
+ Ewk_Touch_Point* touchPoint = static_cast<Ewk_Touch_Point*>(data);
+ ASSERT(touchPoint);
+
+ if ((touchPoint->state == EVAS_TOUCH_POINT_UP) || (touchPoint->state == EVAS_TOUCH_POINT_CANCEL)) {
+ delete touchPoint;
+ m_touchPoints = eina_list_remove_list(m_touchPoints, list);
+ } else
+ touchPoint->state = EVAS_TOUCH_POINT_STILL;
+ }
+}
+
void EventSenderProxy::addTouchPoint(int x, int y)
{
- notImplemented();
+ int id = 0;
+ if (m_touchPoints) {
+ Eina_List* last = eina_list_last(m_touchPoints);
+ Ewk_Touch_Point* touchPoint = static_cast<Ewk_Touch_Point*>(eina_list_data_get(last));
+ ASSERT(touchPoint);
+
+ id = touchPoint->id + 1;
+ }
+
+ Ewk_Touch_Point* touchPoint = new Ewk_Touch_Point;
+ touchPoint->id = id;
+ touchPoint->x = x;
+ touchPoint->y = y;
+ touchPoint->state = EVAS_TOUCH_POINT_DOWN;
+
+ m_touchPoints = eina_list_append(m_touchPoints, touchPoint);
}
void EventSenderProxy::updateTouchPoint(int index, int x, int y)
{
- notImplemented();
+ ASSERT(index >= 0 && index < eina_list_count(m_touchPoints));
+
+ Ewk_Touch_Point* touchPoint = static_cast<Ewk_Touch_Point*>(eina_list_nth(m_touchPoints, index));
+ ASSERT(touchPoint);
+
+ touchPoint->x = x;
+ touchPoint->y = y;
+ touchPoint->state = EVAS_TOUCH_POINT_MOVE;
}
void EventSenderProxy::setTouchModifier(WKEventModifiers modifier, bool enable)
{
- notImplemented();
+ for (unsigned index = 0; index < (sizeof(modifierNames) / sizeof(char*)); ++index) {
+ if (modifier & (1 << index)) {
+ if (enable)
+ evas_key_modifier_on(evas_object_evas_get(m_testController->mainWebView()->platformView()), modifierNames[index]);
+ else
+ evas_key_modifier_off(evas_object_evas_get(m_testController->mainWebView()->platformView()), modifierNames[index]);
+ }
+ }
}
void EventSenderProxy::touchStart()
{
- notImplemented();
+ sendTouchEvent(EWK_TOUCH_START);
}
void EventSenderProxy::touchMove()
{
- notImplemented();
+ sendTouchEvent(EWK_TOUCH_MOVE);
}
void EventSenderProxy::touchEnd()
{
- notImplemented();
+ sendTouchEvent(EWK_TOUCH_END);
}
void EventSenderProxy::touchCancel()
{
- notImplemented();
+ sendTouchEvent(EWK_TOUCH_CANCEL);
}
void EventSenderProxy::clearTouchPoints()
{
- notImplemented();
+ void* data = ""
+ EINA_LIST_FREE(m_touchPoints, data)
+ delete static_cast<Ewk_Touch_Point*>(data);
}
void EventSenderProxy::releaseTouchPoint(int index)
{
- notImplemented();
+ ASSERT(index >= 0 && index < eina_list_count(m_touchPoints));
+
+ Ewk_Touch_Point* touchPoint = static_cast<Ewk_Touch_Point*>(eina_list_nth(m_touchPoints, index));
+ ASSERT(touchPoint);
+
+ touchPoint->state = EVAS_TOUCH_POINT_UP;
}
void EventSenderProxy::cancelTouchPoint(int index)
{
- notImplemented();
+ ASSERT(index >= 0 && index < eina_list_count(m_touchPoints));
+
+ Ewk_Touch_Point* touchPoint = static_cast<Ewk_Touch_Point*>(eina_list_nth(m_touchPoints, index));
+ ASSERT(touchPoint);
+
+ touchPoint->state = EVAS_TOUCH_POINT_CANCEL;
}
void EventSenderProxy::setTouchPointRadius(int radiusX, int radiusY)