diff options
author | Steve Howard <showard@google.com> | 2010-07-23 18:30:16 -0700 |
---|---|---|
committer | Steve Howard <showard@google.com> | 2010-07-23 18:36:00 -0700 |
commit | 691fc58e9a61d99ab5018c5ddc8349ed413e4470 (patch) | |
tree | 90151f31b32c63d46c19ad5383cc9ab0bef9d416 /tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java | |
parent | 71aab521efba9b28779541440c797220ec98ac97 (diff) | |
download | android_packages_providers_DownloadProvider-691fc58e9a61d99ab5018c5ddc8349ed413e4470.tar.gz android_packages_providers_DownloadProvider-691fc58e9a61d99ab5018c5ddc8349ed413e4470.tar.bz2 android_packages_providers_DownloadProvider-691fc58e9a61d99ab5018c5ddc8349ed413e4470.zip |
Test + utilize change notification in DownloadProvider
Now that I've learned how ContentResolver.notifyChange() works, add a
test to explicitly check it's being called in DownloadProvider, and
take advantage of it in waitForDownloadToStop to get rid of the ugly
old polling mechanism.
Change-Id: Iba71bdf1b0d31454cc4e186ceb4fdd9fdb5faad5
Diffstat (limited to 'tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java')
-rw-r--r-- | tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java b/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java index 7982ef4a..3d32ae3c 100644 --- a/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java +++ b/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java @@ -472,6 +472,19 @@ public class PublicApiFunctionalTest extends AbstractDownloadManagerFunctionalTe download.runUntilStatus(DownloadManager.STATUS_SUCCESSFUL); } + public void testContentObserver() throws Exception { + enqueueEmptyResponse(HTTP_OK); + enqueueRequest(getRequest()); + mResolver.resetNotified(); + startService(null); + synchronized(mResolver) { + if (!mResolver.mNotifyWasCalled) { + mResolver.wait(2000); + } + } + assertTrue(mResolver.mNotifyWasCalled); + } + private void runSimpleFailureTest(int expectedErrorCode) throws Exception { Download download = enqueueRequest(getRequest()); download.runUntilStatus(DownloadManager.STATUS_FAILED); |