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

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

Issue 1993873003: deprecate notificationId for downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests 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/SystemDownloadNotifierTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/SystemDownloadNotifierTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/SystemDownloadNotifierTest.java
index 3b13768e982352153c243f6d7fbf0abdba6b3d84..4f68aa96d15fc6bf8b494efc15435592dd24e9d5 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/SystemDownloadNotifierTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/SystemDownloadNotifierTest.java
@@ -38,6 +38,12 @@ public class SystemDownloadNotifierTest extends InstrumentationTestCase {
void stopService() {
mStarted = false;
}
+
+ @Override
+ void onSuccessNotificationShown(
+ final SystemDownloadNotifier.PendingNotificationInfo notificationInfo,
+ final int notificationId) {
+ }
}
@Override
@@ -70,13 +76,12 @@ public class SystemDownloadNotifierTest extends InstrumentationTestCase {
@Feature({"Download"})
public void testNotificationNotHandledUntilServiceConnection() {
DownloadInfo info = new DownloadInfo.Builder()
- .setDownloadGuid(UUID.randomUUID().toString()).setNotificationId(1).build();
+ .setDownloadGuid(UUID.randomUUID().toString()).build();
mDownloadNotifier.notifyDownloadProgress(info, 1L, true);
assertTrue(mDownloadNotifier.mStarted);
onServiceConnected();
assertEquals(1, mService.getNotificationIds().size());
- assertTrue(mService.getNotificationIds().contains(1));
}
/**
@@ -87,16 +92,16 @@ public class SystemDownloadNotifierTest extends InstrumentationTestCase {
public void testServiceStoppedWhenAllDownloadsFinish() {
onServiceConnected();
DownloadInfo info = new DownloadInfo.Builder()
- .setDownloadGuid(UUID.randomUUID().toString()).setNotificationId(1).build();
+ .setDownloadGuid(UUID.randomUUID().toString()).build();
mDownloadNotifier.notifyDownloadProgress(info, 1L, true);
assertTrue(mDownloadNotifier.mStarted);
DownloadInfo info2 = new DownloadInfo.Builder()
- .setDownloadGuid(UUID.randomUUID().toString()).setNotificationId(2).build();
+ .setDownloadGuid(UUID.randomUUID().toString()).build();
mDownloadNotifier.notifyDownloadProgress(info2, 1L, true);
mDownloadNotifier.notifyDownloadFailed(info);
assertTrue(mDownloadNotifier.mStarted);
- mDownloadNotifier.notifyDownloadSuccessful(info2, null);
+ mDownloadNotifier.notifyDownloadSuccessful(info2, 100L, true, null);
assertFalse(mDownloadNotifier.mStarted);
}
}

Powered by Google App Engine
This is Rietveld 408576698