summaryrefslogtreecommitdiffstats
path: root/tests/Android.mk
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-06-09 17:50:07 -0700
committerSteve Howard <showard@google.com>2010-06-28 16:20:22 -0700
commitd6f9b5e72a135365f2358d79b3ea3c9f7cb99c8e (patch)
tree5c0448812dd65aaed0f0f82018dbcac3ac218867 /tests/Android.mk
parentaed3c4a57f6040349ef9e789646305c58227c35a (diff)
downloadandroid_packages_providers_DownloadProvider-d6f9b5e72a135365f2358d79b3ea3c9f7cb99c8e.zip
android_packages_providers_DownloadProvider-d6f9b5e72a135365f2358d79b3ea3c9f7cb99c8e.tar.gz
android_packages_providers_DownloadProvider-d6f9b5e72a135365f2358d79b3ea3c9f7cb99c8e.tar.bz2
First pass at a functional test for the Download Manager.
This "Large" test sets up an HTTP server on the device using MockWebServer and then initiates downloads from that server through the download manager. It uses ServiceTestCase to control the construction and execution of the DownloadService, and it uses some logic from ProviderTestCase2 to construct a DownloadProvider and a ContentResolver that uses it. This setup gives us some ability to mock dependencies. This commit includes use of a fake ConnectivityManager to test responses to connectivity changes, and use of some customizations to MockWebServer to test resuming an interrupted download. This test is disabled, though, since it requires a very long sleep. Avoiding that, and achieving certain other things, will require changes to the Download Manager code itself to introduce new seams. I wanted to check this in before I started such changes. Change-Id: Iefb13b3c3cccdc13fabe5cc18703e13244805539
Diffstat (limited to 'tests/Android.mk')
-rw-r--r--tests/Android.mk15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/Android.mk b/tests/Android.mk
index e9e3a87..80a1c76 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -1,10 +1,17 @@
LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
-########################
+# We only want this apk build for tests.
+LOCAL_MODULE_TAGS := tests
-include $(CLEAR_VARS)
+# Include all test java files.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_INSTRUMENTATION_FOR := DownloadProvider
+LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_PACKAGE_NAME := DownloadProviderTests
+LOCAL_CERTIFICATE := media
-# no tests to build for now
+include $(BUILD_PACKAGE)
# additionally, build sub-tests in a separate .apk
-include $(call all-makefiles-under,$(LOCAL_PATH)) \ No newline at end of file
+include $(call all-makefiles-under,$(LOCAL_PATH))