Here I understand that the broadcast of the test object is mainly obtained through two channels:
1, through the manifest.xml static registration of the broadcast, used to listen to the system broadcast after the operation of its own business logic;
2, through the dynamic registration form of broadcasting, the object is how to send broadcast and receive broadcast after the execution of the logic;
In fact, the 1th is not related to the broadcast test discussed here, the main test object is the logic after receiving, need to design the corresponding unit test case to test, 2nd, the test object is divided into two parts, broadcast is sent correctly? Is the post-receive processing logic correct?
There is a detail to illustrate:
I wrote a receiver to receive the broadcast sent by the application under test, but note that: if the application receiving the broadcast has not been launched since the installation, is not receiving the broadcast (I built the test project will not receive), at this time need to create an empty service to bypass the restrictions, Open service with Intent-filter to open
The road to Android automated testing--broadcasting