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

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

Issue 1809203006: Switch to use download GUID to indentify download items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge error Created 4 years, 9 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 766b8798ca22a516de0543f4dc8864fbd689d43d..c441ca7b43b06de52ed68344317fb8e7597b8352 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
@@ -13,6 +13,8 @@ import org.chromium.base.test.util.AdvancedMockContext;
import org.chromium.base.test.util.Feature;
import org.chromium.content.browser.DownloadInfo;
+import java.util.UUID;
+
/**
* Tests of {@link SystemDownloadNotifier}.
*/
@@ -67,7 +69,8 @@ public class SystemDownloadNotifierTest extends InstrumentationTestCase {
@SmallTest
@Feature({"Download"})
public void testNotificationNotHandledUntilServiceConnection() {
- DownloadInfo info = new DownloadInfo.Builder().setDownloadId(1).build();
+ DownloadInfo info = new DownloadInfo.Builder()
+ .setDownloadGuid(UUID.randomUUID().toString()).setNotificationId(1).build();
mDownloadNotifier.notifyDownloadProgress(info, 1L);
assertTrue(mDownloadNotifier.mStarted);
@@ -83,10 +86,12 @@ public class SystemDownloadNotifierTest extends InstrumentationTestCase {
@Feature({"Download"})
public void testServiceStoppedWhenAllDownloadsFinish() {
onServiceConnected();
- DownloadInfo info = new DownloadInfo.Builder().setDownloadId(1).build();
+ DownloadInfo info = new DownloadInfo.Builder()
+ .setDownloadGuid(UUID.randomUUID().toString()).setNotificationId(1).build();
mDownloadNotifier.notifyDownloadProgress(info, 1L);
assertTrue(mDownloadNotifier.mStarted);
- DownloadInfo info2 = new DownloadInfo.Builder().setDownloadId(2).build();
+ DownloadInfo info2 = new DownloadInfo.Builder()
+ .setDownloadGuid(UUID.randomUUID().toString()).setNotificationId(2).build();
mDownloadNotifier.notifyDownloadProgress(info2, 1L);
mDownloadNotifier.notifyDownloadFailed(info);

Powered by Google App Engine
This is Rietveld 408576698