summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-12-17 17:05:03 -0800
committerJeff Sharkey <jsharkey@android.com>2012-12-17 17:05:03 -0800
commita85832b4772626852142b60c4806ff5384a76478 (patch)
tree29028dabfdc4780da17bacbbbdaa4ff80f33cff0 /tests
parent3b3bbfe2cdd1988a38bcf780191e5273f9a62024 (diff)
downloadandroid_packages_providers_DownloadProvider-a85832b4772626852142b60c4806ff5384a76478.tar.gz
android_packages_providers_DownloadProvider-a85832b4772626852142b60c4806ff5384a76478.tar.bz2
android_packages_providers_DownloadProvider-a85832b4772626852142b60c4806ff5384a76478.zip
Always append to files, handle end of stream.
Fix bug where resumed downloads wouldn't open in append mode. Handle end of stream exceptions from URLConnection as special-case for now to keep tests passing. Move stream creation outside of DrmOutputStream, and always fsync() before closing files. Treat HTTP header errors as retryable. Add explicit state checks to redirection tests. Change-Id: I19d007284f6bfbffaac93859fe47cd98b79a59c4
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java b/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java
index 2661a1f2..1e6b7053 100644
--- a/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java
+++ b/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java
@@ -649,13 +649,14 @@ public class PublicApiFunctionalTest extends AbstractPublicApiTest {
.setHeader("Location", mServer.getUrl(REDIRECTED_PATH).toString()));
enqueueInterruptedDownloadResponses(5);
- Download download = enqueueRequest(getRequest());
- runService();
+ final Download download = enqueueRequest(getRequest());
+ download.runUntilStatus(DownloadManager.STATUS_PAUSED);
+ mSystemFacade.incrementTimeMillis(RETRY_DELAY_MILLIS);
+ download.runUntilStatus(DownloadManager.STATUS_SUCCESSFUL);
+
assertEquals(REQUEST_PATH, takeRequest().getPath());
assertEquals(REDIRECTED_PATH, takeRequest().getPath());
- mSystemFacade.incrementTimeMillis(RETRY_DELAY_MILLIS);
- download.runUntilStatus(DownloadManager.STATUS_SUCCESSFUL);
return takeRequest();
}
}