summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/downloads/SystemFacade.java
diff options
context:
space:
mode:
authorSteve Howard <showard@google.com>2010-06-22 18:20:55 -0700
committerSteve Howard <showard@google.com>2010-07-01 11:35:26 -0700
commit23357198c440e6872d3aef3e608295db7f8273bc (patch)
tree16391d655af983b751b41af5267e8053009a1f2c /src/com/android/providers/downloads/SystemFacade.java
parentb0aada69b9e6258bb9a1a7c1b783d0361ef3c6f2 (diff)
downloadandroid_packages_providers_DownloadProvider-23357198c440e6872d3aef3e608295db7f8273bc.tar.gz
android_packages_providers_DownloadProvider-23357198c440e6872d3aef3e608295db7f8273bc.tar.bz2
android_packages_providers_DownloadProvider-23357198c440e6872d3aef3e608295db7f8273bc.zip
Stub out the system clock in the download manager, add tests
Introduce SystemFacade, an interface that allows us to stub out the system clock for testing the download manager. This allows us to test retrying a failed download without having the test wait 60 seconds. This interface can include other dependencies in the future as well. I've also used this to add tests for 503 (retry-after) and 301 (redirect), and I've added a test for download to the cache partition. Other changes: * made MockWebServer capable of checking + rethrowing exceptions from child threads * refactoring + cleanup of DownloadManagerFunctionalTest
Diffstat (limited to 'src/com/android/providers/downloads/SystemFacade.java')
-rw-r--r--src/com/android/providers/downloads/SystemFacade.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/SystemFacade.java b/src/com/android/providers/downloads/SystemFacade.java
new file mode 100644
index 00000000..4498877d
--- /dev/null
+++ b/src/com/android/providers/downloads/SystemFacade.java
@@ -0,0 +1,6 @@
+
+package com.android.providers.downloads;
+
+interface SystemFacade {
+ public long currentTimeMillis();
+}