(In reply to Ting-Yu Lin [:TYLin] (UTC-7) from comment #1)
test_accessiblecaret_selection_mode.py are important tests for AccessibleCaret, i.e. the selection handles when long-pressing on text on touchable device. Marionette was chosen because
flick can simulate the user's movement of the caret. I'm not aware browser chrome or mochitests can do something similar.
I think rewrite the tests in browser chrome or mochitests is out of scope beacuse we need to rewrite
selection.py  which the two tests havily rely on.
Alright. So lets see...
I saw new APIs was added in Bug 1533786. The tests use only
key_up in the legacy action. Is it possible to rewrite
flick in terms of the new APIs?
key_up should be covered already.
I tried to do that with the Action primitives
pointerUp, but wasn't lucky. Maybe I just missed a small thing. If you need flick, you would have to create a shared module in the test folder both test files could make use of.
With bug 1354578 we are working to get rid of the legacy actions implementation in Marionette. But as noticed some layout tests still depend on those, and after some first quick tries I haven't found a way to get those converted.
I'm curious to know what have you tried, and what fails. Note that by default, AccessibleCaret is not working with mouse actions, but we can turn on
layout.accessiblecaret.hide_carets_for_mouse_input preference to have it show up with mouse actions.
Oh, that might have been the problem here. I used the pointerType
mouse(which is the default), but didn't select
touch. If enabling mouse actions would be ok, it might be easier. Note that I can't remember that we have added tests for
touch yet, so it might fail. Also the new actions will only work in content context.
Also the coordinate is on the element while
pointer_move defaults to viewport . That's something I can think of that your attempt might have failed.
Yes, for now it would be fine to use the moz:useNonSpecCompliantPointerOrigin (https://firefox-source-docs.mozilla.org/testing/geckodriver/Capabilities.html#moz-usenonspeccompliantpointerorigin) capability to keep the old behavior. If there is time to make it without the capability, we would appreciate that.
In all, if this is blocking you immediately, I can looking into it, and get rid of legacy actions in the two tests. Otherwise, if you have chance to get the tests work under new APIs, I'm also happy to review the patch.
Sadly I won't have the time to work on it myself. But we would really appreciate if we could get rid of using the legacy actions here. It blocks a refactoring we have to do, which itself is necessary to further improve various action endpoints.