| Index: chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java
|
| index c7a82f95bd932ed95e54ff11a9b7533642e7b2ed..19e954a4169a5462a8e9a7c021ea7066ad74c5be 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java
|
| @@ -27,6 +27,7 @@ import org.chromium.base.test.BaseJUnit4ClassRunner;
|
| import org.chromium.base.test.util.Feature;
|
| import org.chromium.base.test.util.MinAndroidSdkLevel;
|
| import org.chromium.chrome.R;
|
| +import org.chromium.chrome.browser.notifications.channels.ChannelDefinitions;
|
| import org.chromium.chrome.browser.util.UrlUtilities;
|
| import org.chromium.chrome.browser.widget.RoundedIconGenerator;
|
| import org.chromium.content.browser.test.NativeLibraryTestRule;
|
| @@ -52,9 +53,9 @@ public class StandardNotificationBuilderTest {
|
|
|
| private NotificationBuilderBase createAllOptionsBuilder(
|
| PendingIntent[] outContentAndDeleteIntents) {
|
| - if (outContentAndDeleteIntents == null || outContentAndDeleteIntents.length != 2)
|
| + if (outContentAndDeleteIntents == null || outContentAndDeleteIntents.length != 2) {
|
| throw new IllegalArgumentException();
|
| -
|
| + }
|
| Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
|
|
| Intent contentIntent = new Intent("contentIntent");
|
| @@ -77,7 +78,7 @@ public class StandardNotificationBuilderTest {
|
| new int[] {Color.GRAY}, 1 /* width */, 1 /* height */, Bitmap.Config.ARGB_8888);
|
| actionIcon = actionIcon.copy(Bitmap.Config.ARGB_8888, true /* isMutable */);
|
|
|
| - return new StandardNotificationBuilder(context)
|
| + return new StandardNotificationBuilder(context, ChannelDefinitions.CHANNEL_ID_SITES)
|
| .setTitle("title")
|
| .setBody("body")
|
| .setOrigin("origin")
|
| @@ -174,7 +175,8 @@ public class StandardNotificationBuilderTest {
|
| @Feature({"Browser", "Notifications"})
|
| public void testSetSmallIcon() {
|
| Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
| - NotificationBuilderBase notificationBuilder = new StandardNotificationBuilder(context);
|
| + NotificationBuilderBase notificationBuilder =
|
| + new StandardNotificationBuilder(context, ChannelDefinitions.CHANNEL_ID_SITES);
|
|
|
| Bitmap bitmap =
|
| BitmapFactory.decodeResource(context.getResources(), R.drawable.chrome_sync_logo);
|
| @@ -195,7 +197,8 @@ public class StandardNotificationBuilderTest {
|
| Assert.assertTrue(expected.sameAs(result));
|
|
|
| // Check using the same bitmap on another builder gives the same result.
|
| - NotificationBuilderBase otherBuilder = new StandardNotificationBuilder(context);
|
| + NotificationBuilderBase otherBuilder =
|
| + new StandardNotificationBuilder(context, ChannelDefinitions.CHANNEL_ID_SITES);
|
| otherBuilder.setSmallIcon(bitmap);
|
| Notification otherNotification = otherBuilder.build();
|
| Assert.assertTrue(expected.sameAs(
|
| @@ -214,8 +217,9 @@ public class StandardNotificationBuilderTest {
|
| @Feature({"Browser", "Notifications"})
|
| public void testAddTextActionSetsRemoteInput() {
|
| Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
| - NotificationBuilderBase notificationBuilder = new StandardNotificationBuilder(
|
| - context).addTextAction(null, "Action Title", null, "Placeholder");
|
| + NotificationBuilderBase notificationBuilder =
|
| + new StandardNotificationBuilder(context, ChannelDefinitions.CHANNEL_ID_SITES)
|
| + .addTextAction(null, "Action Title", null, "Placeholder");
|
|
|
| Notification notification = notificationBuilder.build();
|
|
|
|
|