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

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

Issue 2493543003: [Downloads] Pass more DownloadItem state to java (Closed)
Patch Set: Removed dependency Created 4 years, 1 month 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/ui/StubbedProvider.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/download/ui/StubbedProvider.java b/chrome/android/javatests/src/org/chromium/chrome/browser/download/ui/StubbedProvider.java
index 1c34f7eeac1d0e658fba23221556691fb6aae10e..57482922e5bd23237e28be0c7b45c8dd7e5e4290 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/download/ui/StubbedProvider.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/download/ui/StubbedProvider.java
@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.download.DownloadItem;
import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadBridge;
import org.chromium.chrome.browser.offlinepages.downloads.OfflinePageDownloadItem;
import org.chromium.chrome.browser.widget.selection.SelectionDelegate;
+import org.chromium.content_public.browser.DownloadState;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -206,6 +207,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/first_file.jpg")
.setDownloadGuid("first_guid")
.setMimeType("image/jpeg")
+ .setState(DownloadState.COMPLETE)
.build());
} else if (which == 1) {
item = new DownloadItem(false, new DownloadInfo.Builder()
@@ -215,6 +217,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/second_file.gif")
.setDownloadGuid("second_guid")
.setMimeType("image/gif")
+ .setState(DownloadState.COMPLETE)
.build());
} else if (which == 2) {
item = new DownloadItem(false, new DownloadInfo.Builder()
@@ -224,6 +227,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/third_file")
.setDownloadGuid("third_guid")
.setMimeType("text/plain")
+ .setState(DownloadState.COMPLETE)
.build());
} else if (which == 3) {
item = new DownloadItem(false, new DownloadInfo.Builder()
@@ -233,6 +237,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/four.webm")
.setDownloadGuid("fourth_guid")
.setMimeType("video/webm")
+ .setState(DownloadState.COMPLETE)
.build());
} else if (which == 4) {
item = new DownloadItem(false, new DownloadInfo.Builder()
@@ -242,6 +247,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/five.mp3")
.setDownloadGuid("fifth_guid")
.setMimeType("audio/mp3")
+ .setState(DownloadState.COMPLETE)
.build());
} else if (which == 5) {
item = new DownloadItem(false, new DownloadInfo.Builder()
@@ -251,6 +257,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/six.mp3")
.setDownloadGuid("sixth_guid")
.setMimeType("audio/mp3")
+ .setState(DownloadState.COMPLETE)
.build());
} else if (which == 6) {
item = new DownloadItem(false, new DownloadInfo.Builder()
@@ -260,6 +267,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/huge_image.png")
.setDownloadGuid("seventh_guid")
.setMimeType("image/png")
+ .setState(DownloadState.COMPLETE)
.build());
} else if (which == 7) {
item = new DownloadItem(false, new DownloadInfo.Builder()
@@ -269,6 +277,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/sleep.pdf")
.setDownloadGuid("eighth_guid")
.setMimeType("application/pdf")
+ .setState(DownloadState.COMPLETE)
.build());
} else if (which == 8) {
// This is a duplicate of item 7 above.
@@ -279,6 +288,7 @@ public class StubbedProvider implements BackendProvider {
.setFilePath("/storage/fake_path/Downloads/sleep.pdf")
.setDownloadGuid("ninth_guid")
.setMimeType("application/pdf")
+ .setState(DownloadState.COMPLETE)
.build());
} else {
return null;

Powered by Google App Engine
This is Rietveld 408576698