dffbb9c4567e9d29d19964a83129e38dceab7055 |
|
31-Jan-2014 |
Jeff Sharkey <jsharkey@android.com> |
Many improvements to download storage management. 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
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|
7ce206b2108714035eeed29c1dc268a3f1ccf359 |
|
22-Feb-2013 |
Jeff Sharkey <jsharkey@android.com> |
Test to verify extremely large downloads. Streams a 3GB file to verify that it downloads correctly, using new MockWebServer streaming API. Bug: 8209169 Change-Id: Ic36271bfef3176e1ccea2b40edc7abb1044222f1
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|
58eee87b70862a7ced85eabc3c225fad24664065 |
|
29-Jan-2013 |
Jeff Sharkey <jsharkey@android.com> |
Tests for max retries/redirects, ETag switches. 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
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|
0de55602ec6d350548248feddc68c91b29326eff |
|
24-Dec-2012 |
Jeff Sharkey <jsharkey@android.com> |
Simplify download flow control, handle redirects. Move redirection handling into a single loop, and handle each HTTP response code inline to make flow control easier to reason about. Fix race condition in tests by waiting for first status update. Bug: 7887226 Change-Id: Id4bfd182941baad4cd0bb702376c4beeb7275bb2
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|
8ac10e0e0667a4fe35191deebb5fa9786bf4226c |
|
04-Jan-2013 |
Jeff Sharkey <jsharkey@android.com> |
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
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|
ae6856b0fca5215f45619dd031a7e7beae7bd8cc |
|
29-Mar-2012 |
Jeff Sharkey <jsharkey@android.com> |
Migrate to shared MockWebServer. Bug: 4726601 Change-Id: Ibe537bd5c2a092dbf974360cd454751881f7f4ea
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|
5d217003acf21aea852975af0dff3b398cea6768 |
|
07-Dec-2010 |
Vasu Nori <vnori@google.com> |
fix broken DownloadManager tests one big change in this CL is addition of a new feature to MockWebServer. It can now play a long response to the Downloading thread to keep it busy while something - such as cancel/remove - can be done to that Download Request. Also, added changes to FakeSystemFacade to start threads in normal fashion instead of queuing them up and later running just their run() methods. the following tests should work now packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/ DownloadManagerFunctionalTest.java PublicApiFunctionalTest.java ThreadingTest.java PublicApiAccessTest.java DownloadProviderPermissionsTest.java the following are flaky. they need to be split up into smaller tests. frameworks/base/core/tests/coretests/src/android/app/ DownloadManagerIntegrationTest.java DownloadManagerStressTest.java Change-Id: Ia0b11963f92e8f8365f701761dcbce467be3ee9b
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|
a1448628237471a7a2aeb67b560b1502c2bd5ba8 |
|
28-Sep-2010 |
Steve Howard <showard@google.com> |
Manual merge: Moved DownloadManager to android.app Change-Id: Id1de44459ec1bf53e928cae826047467b355823d
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|
e6a05a1aa4697440e9630d12b741b3bae321fe49 |
|
27-Jul-2010 |
Steve Howard <showard@google.com> |
Serialize threading for download manager testing. The download manager uses threading in a simple way -- it launches two threads, UpdateThread and DownloadThread, and both are "fire and forget". This is fortunate for testing, since it means we can eliminate multithreading and simply run each thread in order, and everything still works. This change does just that, abstracting Thread.start() behind SystemFacade and making FakeSystemFacade put new threads into a queue and then run through them serially. This simplifies much of the test code and makes it all much more predictable. I've simplified the test code as much as possible here and moved a few more tests over to PublicApiFunctionalTest, leaving only a minimum in DownloadManagerFunctionalTest, which will eventually be deleted altogether. I've also improved testing in some areas -- for example, we can now test that running notifications get cancelled after the download completes in a robust way. There is one test case that checks for race conditions and requires multithreading. I've moved this into a new ThreadingTest class, which uses a custom FakeSystemFacade that allows multithreading. I've extracted AbstractPublicApiTest for the newly shared code. Change-Id: Ic1d5c76bfa9913fe053174c3d8b516790ca8b25f
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/AbstractPublicApiTest.java
|