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
diff --git a/CtsTestCaseList.mk b/CtsTestCaseList.mk
index dab7b67..e85109d 100644
--- a/CtsTestCaseList.mk
+++ b/CtsTestCaseList.mk
@@ -103,6 +103,7 @@
CtsPermission2TestCases \
CtsPreferenceTestCases \
CtsPreference2TestCases \
+ CtsPrintTestCases \
CtsProviderTestCases \
CtsRenderscriptTestCases \
CtsRenderscriptGraphicsTestCases \
@@ -124,7 +125,6 @@
$(cts_support_packages) \
$(cts_test_packages)
-
# Host side only tests
cts_host_libraries := \
CtsHostUi \
@@ -134,18 +134,21 @@
CtsMonkeyTestCases \
CtsUsbTests
-
# Native test executables that need to have associated test XMLs.
cts_native_exes := \
NativeMediaTest_SL \
NativeMediaTest_XA \
- bionic-unit-tests-cts \
+ bionic-unit-tests-cts
cts_ui_tests := \
CtsUiAutomatorTests
cts_device_jars := \
- CtsDeviceJank
+ CtsDeviceJank \
+ CtsPrintInstrument
+
+cts_device_executables := \
+ print-instrument
# All the files that will end up under the repository/testcases
# directory of the final CTS distribution.
@@ -153,7 +156,8 @@
$(call cts-get-package-paths,$(cts_test_packages)) \
$(call cts-get-native-paths,$(cts_native_exes)) \
$(call cts-get-ui-lib-paths,$(cts_ui_tests)) \
- $(call cts-get-ui-lib-paths,$(cts_device_jars))
+ $(call cts-get-ui-lib-paths,$(cts_device_jars)) \
+ $(call cts-get-executable-paths,$(cts_device_executables))
# All the XMLs that will end up under the repository/testcases
# and that need to be created before making the final CTS distribution.
@@ -162,6 +166,5 @@
$(call cts-get-test-xmls,$(cts_native_exes)) \
$(call cts-get-test-xmls,$(cts_ui_tests))
-
# The following files will be placed in the tools directory of the CTS distribution
CTS_TOOLS_LIST :=
\ No newline at end of file