vendredi 27 mai 2016

How to send an accessibility event from a Junit test and receive the AccessibilityEvent in the same test Android

I need to send an accessibility event from within a Junit test case in Android, or at least an Android test case, and receive it in an onAccessibilityEvent method in the same test class. My app works by receiving accessibility events from other apps, much like talkback, but, for the test cases, I also need to generate the accessibility events so that I don't need to run third party apps over and over to test. I can call my own onAccessibilityEvent method from within a test case, and that works, but when I create my own events, I cannot edit their fields because they are unsealed and throw an exception.

Aucun commentaire:

Enregistrer un commentaire