Skip to content

Commit e1e0613

Browse files
tommynnguyenAndroid (Google) Code Review
authored andcommitted
Merge "Fixing DownloadManager Test app."
2 parents 6f0b2ed + fbfe6d9 commit e1e0613

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerBaseTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,10 @@ protected void setAirplaneModeOn(boolean enable) throws Exception {
491491
*
492492
* @param id The download id to query on (wait for)
493493
*/
494-
private void waitForDownloadOrTimeout_skipNotification(long id) throws TimeoutException,
494+
protected void waitForDownloadOrTimeout_skipNotification(long id) throws TimeoutException,
495495
InterruptedException {
496-
waitForDownloadOrTimeout(id, WAIT_FOR_DOWNLOAD_POLL_TIME, MAX_WAIT_FOR_DOWNLOAD_TIME);
496+
doWaitForDownloadsOrTimeout(new Query().setFilterById(id),
497+
WAIT_FOR_DOWNLOAD_POLL_TIME, MAX_WAIT_FOR_DOWNLOAD_TIME);
497498
}
498499

499500
/**
@@ -505,8 +506,7 @@ private void waitForDownloadOrTimeout_skipNotification(long id) throws TimeoutEx
505506
*/
506507
protected void waitForDownloadOrTimeout(long id) throws TimeoutException,
507508
InterruptedException {
508-
waitForDownloadOrTimeout_skipNotification(id);
509-
waitForReceiverNotifications(1);
509+
waitForDownloadOrTimeout(id, WAIT_FOR_DOWNLOAD_POLL_TIME, MAX_WAIT_FOR_DOWNLOAD_TIME);
510510
}
511511

512512
/**
@@ -813,4 +813,4 @@ protected Cursor getCursor(long id) throws Exception {
813813
}
814814
return cursor;
815815
}
816-
}
816+
}

core/tests/hosttests/test-apps/DownloadManagerTestApp/src/com/android/frameworks/DownloadManagerTestApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public void verifyFileDownloadSucceeded() throws Exception {
208208

209209
// Wait until the download finishes; don't wait for a notification b/c
210210
// the download may well have been completed before the last reboot.
211-
waitForDownloadOrTimeout(dlRequest);
211+
waitForDownloadOrTimeout_skipNotification(dlRequest);
212212

213213
Log.i(LOG_TAG, "Verifying download information...");
214214
// Verify specific info about the file (size, name, etc)...

0 commit comments

Comments
 (0)