summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/providers/downloads/AbstractDownloadProviderFunctionalTest.java
Commit message (Collapse)AuthorAgeFilesLines
* Many improvements to download storage management.Jeff Sharkey2014-02-061-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all data transfer to occur through FileDescriptors instead of relying on local files. This paves the way for downloading directly to content:// Uris in the future. Rewrite storage management logic to preflight download when size is known. If enough space is found, immediately reserve the space with fallocate(), advising the kernel block allocator to try giving us a contiguous block regions to reduce fragmentation. When preflighting on internal storage or emulated external storage, ask PackageManager to clear private app caches to free up space. Since we fallocate() the entire file, use the database as the source of truth for resume locations, which requires that we fsync() before each database update. Store in-progress downloads in separate directories to keep the OS from deleting out from under us. Clean up filename generation logic to break ties in this new dual-directory case. Clearer enforcement of successful download preconditions around content lengths and ETags. Move all database field mutations to clearer DownloadInfoDelta object, and write back through single code path. Catch and log uncaught exceptions from DownloadThread. Tests to verify new storage behaviors. Fixed existing test to reflect correct RFC behavior. Bug: 5287571, 3213677, 12663412 Change-Id: I6bb905eca7c7d1a6bc88df3db28b65d70f660221
* Follow MockWebServer API changes.Jeff Sharkey2013-04-031-5/+0
| | | | Change-Id: Icaba016bc6e098745e56a3b6367a8a6af0151158
* Start using MockStreamResponse.Jeff Sharkey2013-03-251-0/+5
| | | | Change-Id: Ida4a0a85883ccd6763b07e958ddc6ecf7eedf790
* Redesign of DownloadManager update loop.Jeff Sharkey2013-02-121-0/+4
| | | | | | | | | | | | | | | | | | Previously, the service lifecycle was managed through a large for() loop which was extremely tricky to reason about. This resulted in several race conditions that could leave the service running indefinitely, or terminate it early before tasks had finished. This change redesigns the update loop to be event driven based on database updates, and to collapse mutiple pending update passes. It is much easier to reason about service termination conditions, and it correctly uses startId to handle races during command delivery. Also moves scanner into isolated class, and switches to using public API instead of binding to private interface. Bug: 7638470, 7455406, 7162341 Change-Id: I380e77f5432223b2acb4e819e37f29f98ee4782b
* Migrate to using Mockito directly.Jeff Sharkey2013-01-311-1/+1
| | | | Change-Id: Ice24d5c62bbcbcfd3d7374eac3a20580f7f31f36
* Tests for max retries/redirects, ETag switches.Jeff Sharkey2013-01-291-5/+3
| | | | | | | | | | Verify that servers responding with many retries or redirects result in failed download, instead of spinning out of control. Test to verify that changed ETag results in download failing. Also fix handling of HTTP 301 to update Uri in database. Change-Id: Iff2948d79961a245b7900117d107edaa356618c9
* Clean up DownloadManager threading tests.Jeff Sharkey2013-01-081-5/+1
| | | | | | | | | | | 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
* Move notification tests to LittleMock.Jeff Sharkey2012-07-241-15/+13
| | | | | | Directly mock NotificationManager instead of using SystemFacade. Change-Id: If932d26e23816e8674469c275a828701cce5fc2d
* Migrate to shared MockWebServer.Jeff Sharkey2012-03-291-0/+272
Bug: 4726601 Change-Id: Ibe537bd5c2a092dbf974360cd454751881f7f4ea