The attached patch adds a Javascript interface for "injecting" mouse events into a webview, that lets us regression test some of the code paths in WebHTMLView.m. Implemented via Javascript as per Maciej's suggestion, so that events are fed in different run loops. Supplied test cases currently test a double click becoming a word selection, and a drag becoming a selection.
Created attachment 3886 [details] patch
I like the idea behind this patch. Duncan and I discussed some possible naming alternatives on IRC. Instead of: eventInjectController.injectMouseDown() perhaps something like: eventController.mouseDown() eventInjector.mouseDown() eventSource.mouseDown() syntheticEventSource.mouseDown() layoutTestController.eventSource.mouseDown()
Other than the name issue, the patch looks fine to me. marking r- so Duncan can reconsider the name.
Created attachment 4000 [details] patch Renamed to eventSender.mouseDown and similar.
Comment on attachment 4000 [details] patch Looks great to me. r=me Future extensions that might be useful would include keyboard events and the ability to click other buttons besides the main one (and also modified clicks).