summaryrefslogtreecommitdiffstats
path: root/core/tests/hosttests
diff options
context:
space:
mode:
authorNeal Nguyen <tommyn@google.com>2010-10-24 18:02:45 -0700
committerNeal Nguyen <tommyn@google.com>2010-10-29 15:25:11 -0700
commit65c36e6133be04e008bc164b62d42884ff06a13a (patch)
tree9dc6f96870d37c8799f5161c51352ffcd3dabb2a /core/tests/hosttests
parent5ccbe05945325dc77d543d44b69a7f80196d8cb9 (diff)
downloadframeworks_base-65c36e6133be04e008bc164b62d42884ff06a13a.zip
frameworks_base-65c36e6133be04e008bc164b62d42884ff06a13a.tar.gz
frameworks_base-65c36e6133be04e008bc164b62d42884ff06a13a.tar.bz2
A little tweaking of DL Manager tests and adding better debugging output.
Adding more detail to the output logging to help track down issues, fixing some download completed notification counter flakiness and making reboot test more robust, and reducing the number of concurrent downloads in testMultipleDownloads() to 10. After talking with Vasu, this is probably more appropriate as it is closer to typical usage scenarios, and as a side effect should trim some time from the test runs. Large numbers of downloads will be left for stress testing. Change-Id: Ie337cfe9b8d27299d70553e39c60e241ff3afe66
Diffstat (limited to 'core/tests/hosttests')
-rw-r--r--core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerTestApp.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerTestApp.java b/core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerTestApp.java
index c0f670b..e1d7b4c 100644
--- a/core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerTestApp.java
+++ b/core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerTestApp.java
@@ -53,6 +53,8 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest {
protected static long DOWNLOAD_500K_FILESIZE = 570927;
protected static String DOWNLOAD_1MB_FILENAME = "External1mb.apk";
protected static long DOWNLOAD_1MB_FILESIZE = 1041262;
+ protected static String DOWNLOAD_5MB_FILENAME = "External5mb.apk";
+ protected static long DOWNLOAD_5MB_FILESIZE = 5138700;
protected static String DOWNLOAD_10MB_FILENAME = "External10mb.apk";
protected static long DOWNLOAD_10MB_FILESIZE = 10258741;
@@ -135,7 +137,7 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest {
* @throws Exception if unsuccessful
*/
public void initiateDownload() throws Exception {
- String filename = DOWNLOAD_1MB_FILENAME;
+ String filename = DOWNLOAD_5MB_FILENAME;
mContext.deleteFile(DOWNLOAD_STARTED_FLAG);
FileOutputStream fileOutput = mContext.openFileOutput(DOWNLOAD_STARTED_FLAG, 0);
DataOutputStream outputFile = null;
@@ -171,8 +173,8 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest {
* @throws Exception if unsuccessful
*/
public void verifyFileDownloadSucceeded() throws Exception {
- String filename = DOWNLOAD_1MB_FILENAME;
- long filesize = DOWNLOAD_1MB_FILESIZE;
+ String filename = DOWNLOAD_5MB_FILENAME;
+ long filesize = DOWNLOAD_5MB_FILESIZE;
long dlRequest = -1;
boolean rebootMarkerValid = false;
DataInputStream dataInputFile = null;
@@ -205,7 +207,8 @@ public class DownloadManagerTestApp extends DownloadManagerBaseTest {
int status = cursor.getInt(columnIndex);
int currentWaitTime = 0;
- // Wait until the download finishes
+ // Wait until the download finishes; don't wait for a notification b/c
+ // the download may well have been completed before the last reboot.
waitForDownloadOrTimeout(dlRequest);
Log.i(LOG_TAG, "Verifying download information...");