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

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

Issue 1681123002: Plumb Notification action icons through to the UI layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ActionIconResourceFetching
Patch Set: Address peter's comments. 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 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 99eea9d45f9bb7bfe77fa192d4e2806d6a73d489..ef29a6a96fbe2ecdb517f9643c01e3e7bcf159db 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
@@ -41,6 +41,9 @@ public void testSetAll() {
Bitmap largeIcon = Bitmap.createBitmap(
new int[] {Color.RED}, 1 /* width */, 1 /* height */, Bitmap.Config.ARGB_8888);
+ Bitmap actionIcon = Bitmap.createBitmap(
+ new int[] {Color.GRAY}, 1 /* width */, 1 /* height */, Bitmap.Config.ARGB_8888);
+
Notification notification =
new StandardNotificationBuilder(context)
.setSmallIcon(R.drawable.ic_chrome)
@@ -53,7 +56,8 @@ public void testSetAll() {
.setVibrate(new long[] {100L})
.setContentIntent(pendingContentIntent)
.setDeleteIntent(pendingDeleteIntent)
- .addAction(0 /* iconId */, "button", null /* intent */)
+ .addAction(0 /* iconId */, "button 1", null /* intent */)
+ .addAction(actionIcon, "button 2", null /* intent */)
.addSettingsAction(0 /* iconId */, "settings", null /* intent */)
.build();
@@ -68,8 +72,9 @@ public void testSetAll() {
assertEquals(100L, notification.vibrate[0]);
assertEquals(pendingContentIntent, notification.contentIntent);
assertEquals(pendingDeleteIntent, notification.deleteIntent);
- assertEquals(2, notification.actions.length);
- assertEquals("button", notification.actions[0].title);
- assertEquals("settings", notification.actions[1].title);
+ assertEquals(3, notification.actions.length);
+ assertEquals("button1", notification.actions[0].title);
+ assertEquals("button2", notification.actions[1].title);
+ assertEquals("settings", notification.actions[2].title);
}
}

Powered by Google App Engine
This is Rietveld 408576698