RESOLVED FIXED Bug 162934
[iOS WK2] Make it possible for a test to describe a user gesture as a stream of events in JSON format
https://bugs.webkit.org/show_bug.cgi?id=162934
Summary [iOS WK2] Make it possible for a test to describe a user gesture as a stream ...
Simon Fraser (smfr)
Reported 2016-10-04 14:02:51 PDT
[iOS WK2] Make it possible for a test to describe a user gesture as a stream of events in JSON format
Attachments
Patch (23.62 KB, patch)
2016-10-04 14:21 PDT, Simon Fraser (smfr)
no flags
Patch (23.59 KB, patch)
2016-10-04 14:26 PDT, Simon Fraser (smfr)
no flags
Patch (24.08 KB, patch)
2016-10-04 15:19 PDT, Simon Fraser (smfr)
dino: review+
Simon Fraser (smfr)
Comment 1 2016-10-04 14:21:17 PDT
Simon Fraser (smfr)
Comment 2 2016-10-04 14:26:05 PDT
WebKit Commit Bot
Comment 3 2016-10-04 14:27:22 PDT
Attachment 290644 [details] did not pass style-queue: ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:246: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:247: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:248: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:249: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:250: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:251: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:252: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:253: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:254: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:255: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:256: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:257: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:278: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:279: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:286: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:287: One space before end of line comments [whitespace/comments] [5] Total errors found: 16 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 4 2016-10-04 15:19:36 PDT
WebKit Commit Bot
Comment 5 2016-10-04 15:21:29 PDT
Attachment 290653 [details] did not pass style-queue: ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:246: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:247: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:248: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:249: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:250: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:251: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:252: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:253: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:254: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:255: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:256: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:257: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:278: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:279: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:286: One space before end of line comments [whitespace/comments] [5] ERROR: Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:287: One space before end of line comments [whitespace/comments] [5] Total errors found: 16 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dean Jackson
Comment 6 2016-10-04 17:07:59 PDT
Comment on attachment 290653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290653&action=review > Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:57 > + // "inputType" : "hand", It's a bit weird that inputType is "hand" on the parent and "finger" on the child. I guess that's our system style, but maybe we could make it more friendly at this level. > Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:63 > + // "id" : 1, Do we need the id? > Tools/WebKitTestRunner/ios/HIDEventGenerator.h:88 > + > + Too many blank lines! > Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:210 > + // If there are any new or ended events, mask includes touch Nit: . > Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:212 > + eventMask |= kIOHIDDigitizerEventTouch; I think you can return here. Once that is set, nothing else matters. > Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:231 > + CFIndex touch = 0; > + > + NSArray *childEvents = info[HIDEventTouchesKey]; > + for (NSDictionary *touchInfo in childEvents) { > + UITouchPhase phase = phaseFromString(touchInfo[HIDEventPhaseKey]); > + > + if (phase == UITouchPhaseBegan || phase == UITouchPhaseMoved || phase == UITouchPhaseStationary) > + touch = 1; > + } > + > + return touch; Do you need the touch variable? It seems that touch = 1; could be just return 1; and the final statement return 0; > Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:281 > + [touchInfo[HIDEventXKey] floatValue], I can't remember ObjC or CF. If "x" wasn't provided, does this touchInfo[HIDEventXKey] return nil? and does that then provide a 0 floatValue? Should we do any validation on the input before getting here? > Tools/WebKitTestRunner/ios/HIDEventGenerator.mm:962 > + NSLog(@"eventInfo is nil"); Did you really want to log here? > LayoutTests/fast/events/ios/event-stream-single-tap.html:28 > + var eventStream = { > + "events" : [ > + { > + "inputType" : "hand", > + "timeOffset" : 0, Since you JSON.stringify the object you don't need to quote the keys on this end. > LayoutTests/fast/events/ios/event-stream-single-tap.html:63 > + document.getElementById('result').textContent = 'PASS: received click.'; Use consistent quoting :) And never use single quotes :)
Simon Fraser (smfr)
Comment 7 2016-10-04 17:26:47 PDT
Note You need to log in before you can comment on or make changes to this bug.