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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java

Issue 2841193002: Implement privacy disclosure for an unbound webapk. (Closed)
Patch Set: nit Created 3 years, 7 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/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..7c149088d6e431ae5ae3316ea95bfe205e40d217 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,8 +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();
@@ -77,7 +79,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 +176,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 +198,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 +218,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();

Powered by Google App Engine
This is Rietveld 408576698