| Index: chrome/android/javatests/src/org/chromium/chrome/browser/download/MockDownloadNotificationService.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/MockDownloadNotificationService.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/MockDownloadNotificationService.java
|
| index 29737f98ec2f0bf8d0ad689a210380c92d04eaf7..76dccd0885904c066e30ca96be5a2723c80f609d 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/MockDownloadNotificationService.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/MockDownloadNotificationService.java
|
| @@ -9,6 +9,7 @@ import android.content.Context;
|
| import android.util.Pair;
|
|
|
| import org.chromium.base.ThreadUtils;
|
| +import org.chromium.components.offline_items_collection.ContentId;
|
|
|
| import java.util.ArrayList;
|
| import java.util.List;
|
| @@ -78,8 +79,8 @@ public class MockDownloadNotificationService extends DownloadNotificationService
|
| }
|
|
|
| @Override
|
| - public void cancelNotification(int notificationId, String downloadGuid) {
|
| - super.cancelNotification(notificationId, downloadGuid);
|
| + public void cancelNotification(int notificationId, ContentId id) {
|
| + super.cancelNotification(notificationId, id);
|
| mNotificationIds.remove(Integer.valueOf(notificationId));
|
| }
|
|
|
| @@ -93,52 +94,49 @@ public class MockDownloadNotificationService extends DownloadNotificationService
|
| }
|
|
|
| @Override
|
| - public int notifyDownloadSuccessful(final String downloadGuid, final String filePath,
|
| + public int notifyDownloadSuccessful(final ContentId id, final String filePath,
|
| final String fileName, final long systemDownloadId, final boolean isOffTheRecord,
|
| - final boolean isOfflinePage, final boolean isSupportedMimeType) {
|
| + final boolean isSupportedMimeType) {
|
| return ThreadUtils.runOnUiThreadBlockingNoException(new Callable<Integer>() {
|
| @Override
|
| public Integer call() throws Exception {
|
| - return MockDownloadNotificationService.super.notifyDownloadSuccessful(downloadGuid,
|
| - filePath, fileName, systemDownloadId, isOffTheRecord, isOfflinePage,
|
| - isSupportedMimeType);
|
| + return MockDownloadNotificationService.super.notifyDownloadSuccessful(id, filePath,
|
| + fileName, systemDownloadId, isOffTheRecord, isSupportedMimeType);
|
| }
|
| });
|
| }
|
|
|
| @Override
|
| - public void notifyDownloadProgress(final String downloadGuid, final String fileName,
|
| + public void notifyDownloadProgress(final ContentId id, final String fileName,
|
| final int percentage, final long bytesReceived, final long timeRemainingInMillis,
|
| final long startTime, final boolean isOffTheRecord,
|
| - final boolean canDownloadWhileMetered, final boolean isOfflinePage) {
|
| + final boolean canDownloadWhileMetered) {
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
| public void run() {
|
| - MockDownloadNotificationService.super.notifyDownloadProgress(
|
| - downloadGuid, fileName, percentage, bytesReceived, timeRemainingInMillis,
|
| - startTime, isOffTheRecord, canDownloadWhileMetered, isOfflinePage);
|
| + MockDownloadNotificationService.super.notifyDownloadProgress(id, fileName,
|
| + percentage, bytesReceived, timeRemainingInMillis, startTime, isOffTheRecord,
|
| + canDownloadWhileMetered);
|
| }
|
| });
|
| }
|
|
|
| @Override
|
| - public void notifyDownloadFailed(
|
| - final boolean isOfflinePage, final String downloadGuid, final String fileName) {
|
| + public void notifyDownloadFailed(final ContentId id, final String fileName) {
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
| public void run() {
|
| - MockDownloadNotificationService.super.notifyDownloadFailed(
|
| - isOfflinePage, downloadGuid, fileName);
|
| + MockDownloadNotificationService.super.notifyDownloadFailed(id, fileName);
|
| }
|
| });
|
| }
|
|
|
| @Override
|
| - public void notifyDownloadCanceled(final String downloadGuid) {
|
| + public void notifyDownloadCanceled(final ContentId id) {
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
| public void run() {
|
| - MockDownloadNotificationService.super.notifyDownloadCanceled(downloadGuid);
|
| + MockDownloadNotificationService.super.notifyDownloadCanceled(id);
|
| }
|
| });
|
| }
|
|
|