-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update motion events generation logic #210
Conversation
@Test(expected = ActionsParseException.class) | ||
public void verifyChainPreprocessingFailsIfMultiplePointerTypesArePresent() throws JSONException { | ||
final JSONArray actionJson = new JSONArray("[ {" + | ||
"\"type\": \"pointer\"," + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh. Does Java have nothing like a here-doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately not. They've just added something like that into java10 spec
00e65b4
to
8ad74dc
Compare
8ad74dc
to
5f42f0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code is a bit too much for me to comment on right now, but the behavior isn't really working in my test case. what i'm seeing is weird in 2 ways:
- a move of 1500ms is taking more like 10 seconds
- every "synthesized motionevent" says "success" except for the very first move event, which says "fail". the drag actually looks like it works, but then the server responds with an error.
(see gist for logs: https://gist.github.com/jlipps/852c7c65c49c0070f84bd479fd6dbd72) |
FWIW i went back to the 1.9.1 official release and it is working, however the slowness issue is still present. i think the time conversion for the pointer move is problematic somehow. |
Thanks a lot @jlipps. I'll add the necessary fixes |
When I ran A double tap action combined with pause and pointer_down by own worked. Except for it, it worked in some test cases. |
@KazuCocoa I'd say such behaviour is expected, since there must be a pause between pointer down and pointer up. For a single click it is about 100-125 ms. Also Android defines minimum 40 ms delay between clicks to be recognised as double click. How do you think, would it be more logical to throw ActionParseException if such chain is parsed or leave it as is and let it fail on execution stage? |
1.9.1 didn't work for some actions... It's a helpful hint for users to understand why it doesn't work, I think. |
@KazuCocoa Added the case above into the set of unit tests |
Of course it did not. This feature has never been tested properly. This is the idea to have this PR and fix as much problems as possible and also improve the quality of the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've added some built-in actions in the test suite and they also worked.
It is the same content as in #209, which has been non intentionally corrupted %)