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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsUpdaterTest.java

Issue 2832433002: [Android O] Refactor channel definitions into new class (Closed)
Patch Set: rebase 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
Index: chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsUpdaterTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsUpdaterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsUpdaterTest.java
index e3ef2f47922d7717fadb108e6f2f663476044c11..7e725b9ece40c6b28ca8af47768b8e6fbe15fdde 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsUpdaterTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/notifications/ChannelsUpdaterTest.java
@@ -31,7 +31,8 @@ public class ChannelsUpdaterTest {
@Before
public void setUp() throws Exception {
mMockNotificationManager = new MockNotificationManagerProxy();
- mChannelsInitializer = new ChannelsInitializer(mMockNotificationManager);
+ mChannelsInitializer =
+ new ChannelsInitializer(mMockNotificationManager, new ChannelDefinitions());
mMockSharedPreferences = new InMemorySharedPreferences();
}
@@ -84,23 +85,22 @@ public class ChannelsUpdaterTest {
assertThat(mMockNotificationManager.getChannels().size(), is(greaterThan(0)));
assertThat(mMockNotificationManager.getNotificationChannelIds(),
- containsInAnyOrder(ChannelsInitializer.CHANNEL_ID_BROWSER,
- ChannelsInitializer.CHANNEL_ID_DOWNLOADS,
- ChannelsInitializer.CHANNEL_ID_INCOGNITO,
- ChannelsInitializer.CHANNEL_ID_SITES,
- ChannelsInitializer.CHANNEL_ID_MEDIA));
+ containsInAnyOrder(ChannelDefinitions.CHANNEL_ID_BROWSER,
+ ChannelDefinitions.CHANNEL_ID_DOWNLOADS,
+ ChannelDefinitions.CHANNEL_ID_INCOGNITO,
+ ChannelDefinitions.CHANNEL_ID_SITES, ChannelDefinitions.CHANNEL_ID_MEDIA));
assertThat(mMockSharedPreferences.getInt(ChannelsUpdater.CHANNELS_VERSION_KEY, -1), is(21));
}
// Suppressed in order to construct the old channels with invalid parameters.
@SuppressWarnings("WrongConstant")
@Test
- public void testUpdateChannels_deletesOldChannelsAndCreatesExpectedOnes() throws Exception {
- mMockNotificationManager.createNotificationChannel(new ChannelsInitializer.Channel(
+ public void testUpdateChannels_deletesLegacyChannelsAndCreatesExpectedOnes() throws Exception {
+ mMockNotificationManager.createNotificationChannel(new ChannelDefinitions.Channel(
"OldChannel", 8292304, NotificationManager.IMPORTANCE_HIGH,
- ChannelsInitializer.CHANNEL_GROUP_ID_GENERAL));
+ ChannelDefinitions.CHANNEL_GROUP_ID_GENERAL));
mMockNotificationManager.createNotificationChannel(
- new ChannelsInitializer.Channel("AnotherOldChannel", 8292304,
+ new ChannelDefinitions.Channel("AnotherOldChannel", 8292304,
NotificationManager.IMPORTANCE_LOW, "OldChannelGroup"));
assertThat(mMockNotificationManager.getNotificationChannelIds(),
containsInAnyOrder("OldChannel", "AnotherOldChannel"));
@@ -110,10 +110,9 @@ public class ChannelsUpdaterTest {
updater.updateChannels();
assertThat(mMockNotificationManager.getNotificationChannelIds(),
- containsInAnyOrder(ChannelsInitializer.CHANNEL_ID_BROWSER,
- ChannelsInitializer.CHANNEL_ID_DOWNLOADS,
- ChannelsInitializer.CHANNEL_ID_INCOGNITO,
- ChannelsInitializer.CHANNEL_ID_SITES,
- ChannelsInitializer.CHANNEL_ID_MEDIA));
+ containsInAnyOrder(ChannelDefinitions.CHANNEL_ID_BROWSER,
+ ChannelDefinitions.CHANNEL_ID_DOWNLOADS,
+ ChannelDefinitions.CHANNEL_ID_INCOGNITO,
+ ChannelDefinitions.CHANNEL_ID_SITES, ChannelDefinitions.CHANNEL_ID_MEDIA));
}
}

Powered by Google App Engine
This is Rietveld 408576698