Bug 149738

Summary: Convert svg/animation tests to not use eventSender, so they run on iOS
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ap, dino, lforschler, simon.fraser
Priority: P2    
Version: Safari 9   
Hardware: Unspecified   
OS: Unspecified   

Simon Fraser (smfr)
Reported 2015-10-01 19:16:01 PDT
Tests that use LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js, like all the svg/animation tests, make use of eventSender to fake a click event: function clickAt(x, y) { // Translation due to <h1> above us x = x + rootSVGElement.offsetLeft; y = y + rootSVGElement.offsetTop; if (window.eventSender) { eventSender.mouseMoveTo(x, y); eventSender.mouseDown(); eventSender.mouseUp(); } } We should fix this so that the tests run on iOS.
Attachments
Simon Fraser (smfr)
Comment 1 2015-10-01 19:36:37 PDT
I tried dispatching a synthetic click event, and most tests worked bug svg/animations/use-animate-width-and-height.html failed.
Simon Fraser (smfr)
Comment 2 2015-10-01 19:37:45 PDT
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js b/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js index 6936786e5c26b69055aac391da66c30543907796..a77ea711e52db7ac285aada3aa3e46807fbc8e30 100644 --- a/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js +++ b/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js @@ -46,11 +46,24 @@ function clickAt(x, y) { x = x + rootSVGElement.offsetLeft; y = y + rootSVGElement.offsetTop; - if (window.eventSender) { - eventSender.mouseMoveTo(x, y); - eventSender.mouseDown(); - eventSender.mouseUp(); - } + // if (window.eventSender) { + // eventSender.mouseMoveTo(x, y); + // eventSender.mouseDown(); + // eventSender.mouseUp(); + // } + + var target = document.elementFromPoint(x, y); + var event = new MouseEvent('click', { + 'view': window, + 'bubbles': true, + 'cancelable': true, + 'clientX': x, + 'clientY': y + }); + + window.console.log('sending click at ' + x + ' ' + y + ' to ' + target) + + target.dispatchEvent(event); } function completeTest() {
Note You need to log in before you can comment on or make changes to this bug.