summaryrefslogtreecommitdiffstats
path: root/tests/src/tests
Commit message (Collapse)AuthorAgeFilesLines
* Stub out the system clock in the download manager, add testsSteve Howard2010-07-011-2/+31
| | | | | | | | | | | | | | 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
* First pass at a functional test for the Download Manager.Steve Howard2010-06-283-23/+59
| | | | | | | | | | | | | | | | | | | | | 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
* Check in copies of MockWebServer + friends.Steve Howard2010-06-213-0/+486
This commit includes unmodified copies of MockWebServer and its supporting classes, taken from dalvik-dev:libcore/support/src/tests/java. My test will require some changes, but I'm committing unchanged versions first so I can more easily track my changes and eventually merge them back over. Change-Id: Ic4b79c7a2cbd3bd439864ed94c43fe985eae8e78