Bug 4963

Summary: Would like to simulate human interaction with webview
Product: WebKit Reporter: Duncan Wilcox <duncan>
Component: Tools / TestsAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Enhancement CC: darin
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
patch
mjs: review-
patch mjs: review+

Description Duncan Wilcox 2005-09-13 01:29:20 PDT
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.
Comment 1 Duncan Wilcox 2005-09-13 01:30:41 PDT
Created attachment 3886 [details]
patch
Comment 2 Maciej Stachowiak 2005-09-13 02:56:29 PDT
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()
Comment 3 Maciej Stachowiak 2005-09-21 00:52:58 PDT
Other than the name issue, the patch looks fine to me. marking r- so Duncan can reconsider the name.
Comment 4 Duncan Wilcox 2005-09-22 02:20:31 PDT
Created attachment 4000 [details]
patch

Renamed to eventSender.mouseDown and similar.
Comment 5 Maciej Stachowiak 2005-09-23 18:28:03 PDT
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).