On 04/12/2018 02:23, Masayuki Nakano wrote:
On 2018/11/30 20:42, James Graham wrote:
On 30/11/2018 01:37, Masayuki Nakano wrote:
web-platform-tests: N/A due to requiring user input, but we have
mochitests with synthesized events.
I think it should be possible to write web-platform-tests for this
kind of thing now, using the testdriver API and in particular the
actions support see e.g. , 
If this still doesn't meet your use case please let me know because we
should work out how to make testing this kind of stuff possible
cross-browser; as you well know UI events have been an interop
nightmare in the past and we can't afford to let that situation
continue into the future for new devices and APIs.
Thank you for the information.
I'm looking for the implementation of the keyboard event dispatchers,
but I've not found it yet. Could you let me know where it is?
So, the full picture is that the test harness provides a js
implementation of the testdriver API action_sequence method  which
routes a message to the harness asking it to dispatch some actions. In
the marionette backend this ends up at  which sends a
WebDriver:PerformActions command to the browser. That ends up in  and
then  and  which in the case of a key event goes through  and,
skipping several layers of setup, eventually . That is ultimately
using nsITextInputProcessor, and the implementation looks extremely
similar to synthesizeKey from EventUtils.js .
So I believe that unless one of the intervening layers is doing
something wrong or putting unnecessary constraints on what's possible,
it should be possible to use this API to generate the exact same events
that you would get from EventUtils.js. If there are use cases you are
unable to replicate using the testdriver API please let me know because
they are likely bugs that ought to be fixed; the intent here is that the
events looks as close as possible to real key events generated by real
dev-platform mailing list