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

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

Issue 1673183003: add pause button for resumable in-progress downloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding assert Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.download; 5 package org.chromium.chrome.browser.download;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.content.SharedPreferences; 9 import android.content.SharedPreferences;
10 import android.os.IBinder; 10 import android.os.IBinder;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 /** 92 /**
93 * Tests adding and cancelling notifications. 93 * Tests adding and cancelling notifications.
94 */ 94 */
95 @SmallTest 95 @SmallTest
96 @Feature({"Download"}) 96 @Feature({"Download"})
97 public void testAddingAndCancelingNotifications() { 97 public void testAddingAndCancelingNotifications() {
98 setupService(); 98 setupService();
99 startNotificationService(); 99 startNotificationService();
100 DownloadNotificationService service = bindNotificationService(); 100 DownloadNotificationService service = bindNotificationService();
101 service.notifyDownloadProgress(1, "test", -1, 1L, 1L); 101 service.notifyDownloadProgress(1, "test", -1, 1L, 1L, true);
102 assertEquals(1, getService().getNotificationIds().size()); 102 assertEquals(1, getService().getNotificationIds().size());
103 assertTrue(getService().getNotificationIds().contains(1)); 103 assertTrue(getService().getNotificationIds().contains(1));
104 104
105 service.notifyDownloadSuccessful(2, "test2", null); 105 service.notifyDownloadSuccessful(2, "test2", null);
106 assertEquals(2, getService().getNotificationIds().size()); 106 assertEquals(2, getService().getNotificationIds().size());
107 assertTrue(getService().getNotificationIds().contains(2)); 107 assertTrue(getService().getNotificationIds().contains(2));
108 108
109 service.notifyDownloadFailed(3, "test3"); 109 service.notifyDownloadFailed(3, "test3");
110 assertEquals(3, getService().getNotificationIds().size()); 110 assertEquals(3, getService().getNotificationIds().size());
111 assertTrue(getService().getNotificationIds().contains(3)); 111 assertTrue(getService().getNotificationIds().contains(3));
112 112
113 service.cancelNotification(1); 113 service.cancelNotification(1);
114 assertEquals(2, getService().getNotificationIds().size()); 114 assertEquals(2, getService().getNotificationIds().size());
115 assertFalse(!getService().getNotificationIds().contains(1)); 115 assertFalse(!getService().getNotificationIds().contains(1));
116 } 116 }
117 } 117 }
OLDNEW
« no previous file with comments | « chrome/android/java/strings/android_chrome_strings.grd ('k') | chrome/browser/android/download/download_manager_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698