Clean up DownloadManager threading tests.
authorJeff Sharkey <jsharkey@android.com>
Fri, 4 Jan 2013 06:59:50 +0000 (22:59 -0800)
committerJeff Sharkey <jsharkey@android.com>
Tue, 8 Jan 2013 22:11:28 +0000 (14:11 -0800)
commit8ac10e0e0667a4fe35191deebb5fa9786bf4226c
tree8edfa0be4348b8f25a8dadaad6a9e8ae80525323
parent701d66efeff513a7509eeaafab6e47f4f6edb857
Clean up DownloadManager threading tests.

Change runUntilStatus() methods to polling with timeout instead of
requiring internal knowledge about threading.

Fix notification tests, and move opening of InputStream until after
handling headers to avoid FNFE.  Always reset facade to defaults
before each test.

Change-Id: I6b2d6cfc4e685d2090c1133b1b2e89ae12760f8b
12 files changed:
src/com/android/providers/downloads/DownloadHandler.java
src/com/android/providers/downloads/DownloadInfo.java
src/com/android/providers/downloads/DownloadService.java
src/com/android/providers/downloads/DownloadThread.java
src/com/android/providers/downloads/RealSystemFacade.java
src/com/android/providers/downloads/SystemFacade.java
tests/src/com/android/providers/downloads/AbstractDownloadProviderFunctionalTest.java
tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
tests/src/com/android/providers/downloads/DownloadProviderFunctionalTest.java
tests/src/com/android/providers/downloads/FakeSystemFacade.java
tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java
tests/src/com/android/providers/downloads/ThreadingTest.java