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

Unified Diff: chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/notifications/MockNotificationManagerProxy.java

Issue 2808163002: [Android O] Refactor channel initialization (Closed)
Patch Set: fix comments Created 3 years, 8 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
« no previous file with comments | « chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsInitializerTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/notifications/MockNotificationManagerProxy.java
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/notifications/MockNotificationManagerProxy.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/notifications/MockNotificationManagerProxy.java
index bd9b9b7782419a4368897615a657806b6f17dd7d..44a86857cdefb68867b196b0ee9d85c084554e3c 100644
--- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/notifications/MockNotificationManagerProxy.java
+++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/notifications/MockNotificationManagerProxy.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.test.util.browser.notifications;
import android.app.Notification;
+import org.chromium.chrome.browser.notifications.ChannelsInitializer;
import org.chromium.chrome.browser.notifications.NotificationManagerProxy;
import java.util.ArrayList;
@@ -21,6 +22,8 @@ import javax.annotation.Nullable;
*/
public class MockNotificationManagerProxy implements NotificationManagerProxy {
private static final String KEY_SEPARATOR = ":";
+ private List<ChannelsInitializer.Channel> mChannels;
+ private List<ChannelsInitializer.ChannelGroup> mNotificationChannelGroups;
/**
* Holds a notification and the arguments passed to #notify and #cancel.
@@ -45,6 +48,8 @@ public class MockNotificationManagerProxy implements NotificationManagerProxy {
public MockNotificationManagerProxy() {
mNotifications = new LinkedHashMap<>();
mMutationCount = 0;
+ mChannels = new ArrayList<>();
+ mNotificationChannelGroups = new ArrayList<>();
}
/**
@@ -91,6 +96,24 @@ public class MockNotificationManagerProxy implements NotificationManagerProxy {
}
@Override
+ public void createNotificationChannel(ChannelsInitializer.Channel channel) {
+ mChannels.add(channel);
+ }
+
+ public List<ChannelsInitializer.Channel> getChannels() {
+ return mChannels;
+ }
+
+ @Override
+ public void createNotificationChannelGroup(ChannelsInitializer.ChannelGroup channelGroup) {
+ mNotificationChannelGroups.add(channelGroup);
+ }
+
+ public List<ChannelsInitializer.ChannelGroup> getNotificationChannelGroups() {
+ return mNotificationChannelGroups;
+ }
+
+ @Override
public void notify(int id, Notification notification) {
notify(null /* tag */, id, notification);
}
« no previous file with comments | « chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsInitializerTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698