Bug 4963 - Would like to simulate human interaction with webview
Summary: Would like to simulate human interaction with webview
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Dave Hyatt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-13 01:29 PDT by Duncan Wilcox
Modified: 2005-09-24 06:54 PDT (History)
1 user (show)

See Also:


Attachments
patch (14.52 KB, patch)
2005-09-13 01:30 PDT, Duncan Wilcox
mjs: review-
Details | Formatted Diff | Diff
patch (16.17 KB, patch)
2005-09-22 02:20 PDT, Duncan Wilcox
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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).