Adding printing CTS tests and some tests.
1. Added infrastructure for writing print tests.
Print tests require mocking both the print application
and the print services. Therefore, both the app and the
services are in the same APK.
Using print services requires that they are enabled by
the user via the UI which changes a secure setting with
the enabled services. The test app cannot change these
settings. Therefore, there is a custom host side test
driver which sets the enabled services setting before
running the tests.
The print spooler keeps track of used printers, hence
running a test changes the state of the spooler potentially
affecting subsequent tests, i.e. the order of runnings
tests begins to matter which is fragile as the test
runner does not guarantee order of execution. However,
the test APK cannot clear the data of another app, i.e the
PrintSpooler. To handle this the host side test driver
installs and calls a shell Java program which creates
a proxy object which has API for clearing an app's
user data (the shell user has permissions to do that)
and passes this proxy to the instrumentation that
contains the tests. Fun!
2. Added tests for the PrintDocumentAdapter lifecycle.
Change-Id: Ie9929c2e364a43b262667c5198967e01858f4389
25 files changed