Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5766)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java

Issue 1993873003: deprecate notificationId for downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java
index 5daf927a987d340183241095fead42c218b9b4f7..6075c7b729e70d7aa7e1acf1b1fc5478e5e0c144 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadNotificationServiceTest.java
@@ -155,26 +155,26 @@ public class DownloadNotificationServiceTest extends
DownloadNotificationService service = bindNotificationService();
String guid3 = UUID.randomUUID().toString();
- service.notifyDownloadProgress(1, guid3, "test", 1, 1L, 1L, true, true);
+ service.notifyDownloadProgress(guid3, "test", 1, 1L, 1L, true, true);
assertEquals(3, getService().getNotificationIds().size());
- assertTrue(getService().getNotificationIds().contains(1));
+ int lastNotificationId = getService().getLastAddedNotificationId();
Set<String> entries = DownloadManagerService.getStoredDownloadInfo(
sharedPrefs, DownloadNotificationService.PENDING_DOWNLOAD_NOTIFICATIONS);
assertEquals(3, entries.size());
- service.notifyDownloadSuccessful(3, guid1, "success", null);
+ service.notifyDownloadSuccessful(guid1, "success", null);
entries = DownloadManagerService.getStoredDownloadInfo(
sharedPrefs, DownloadNotificationService.PENDING_DOWNLOAD_NOTIFICATIONS);
assertEquals(2, entries.size());
- service.notifyDownloadFailed(4, guid2, "failed");
+ service.notifyDownloadFailed(guid2, "failed");
entries = DownloadManagerService.getStoredDownloadInfo(
sharedPrefs, DownloadNotificationService.PENDING_DOWNLOAD_NOTIFICATIONS);
assertEquals(1, entries.size());
- service.cancelNotification(1, guid3);
+ service.notifyDownloadCanceled(guid3);
assertEquals(2, getService().getNotificationIds().size());
- assertFalse(getService().getNotificationIds().contains(1));
+ assertFalse(getService().getNotificationIds().contains(lastNotificationId));
}
/**
@@ -187,9 +187,8 @@ public class DownloadNotificationServiceTest extends
startNotificationService();
DownloadNotificationService service = bindNotificationService();
String guid = UUID.randomUUID().toString();
- service.notifyDownloadSuccessful(1, guid, "test", null);
+ service.notifyDownloadSuccessful(guid, "test", null);
assertEquals(1, getService().getNotificationIds().size());
- assertTrue(getService().getNotificationIds().contains(1));
}
/**

Powered by Google App Engine
This is Rietveld 408576698