On Fri, Sep 7, 2018 at 2:49 PM James Graham <ja...@hoppipolla.co.uk> wrote:

> > web-platform-tests: Our implementation unfortunately doesn’t come with
> > web-platform-tests, for two reasons.  One is that there is currently no
> way
> > to mock user gestures in web platform tests [4], and the second reason is
> > that furthermore, our implementation also depends on being able to
> > manipulate the URL Classifier backend for testing purposes.
>
> So this isn't true, however the present state of affairs may not yet be
> useful to you.
>
> It is currently possible to make basic user actions in wpt using the
> testdriver API [1]. I am helping extend this to allow more general
> guestures via WebDriver-like actions [2].
>

Very cool, I did not know this!  It seems like test_driver.bless() is what
we need here for simulating a user activation gesture.


> However it sounds like in this case you may need to add test-only APIs
> for manipulating internal browser state. There are two possible
> approaches here:
>
> * Add a feature to WebDriver for manipulating this data. This can be
> specified in the StorageManager spec and is appropriate if we want to
> add something that can be used by authors as part of the automated
> testing for their website.
>
> * Add test-only DOM APIs in the StorageManager spec that we can enable
> when running the browser in test mode. Each browser would be expected to
> have some implementation-specific means to enable these APIs when under
> test (e.g. a pref). WebUSB has an example of this approach.
>

This is something that I should get some feedback on from at least WebKit
before deciding on a path forward, but from a Gecko perspective, we
basically need to call one function at the beginning and one function at
the end of each test, so looks like the first option would be sufficient.
Do you happen to have an example of that handy?  I've never done something
like this before, and I do appreciate some pointers to get started.

I'm very happy to learn that it's possible to contribute wpt tests for this
feature!

Thanks,
-- 
Ehsan
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to