| Index: chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
|
| index 3f6562a5b8a50dd60b2be3fdc71952221faa06af..2f5eefe55759279f4a348430f327d81ba64b5dbd 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
|
| @@ -58,23 +58,24 @@ public class CustomNotificationBuilderTest extends NativeLibraryTestBase {
|
| new int[] {Color.WHITE}, 1 /* width */, 1 /* height */, Bitmap.Config.ARGB_8888);
|
| actionIcon = actionIcon.copy(Bitmap.Config.ARGB_8888, true /* isMutable */);
|
|
|
| - Notification notification =
|
| - new CustomNotificationBuilder(context)
|
| - .setSmallIcon(R.drawable.ic_chrome)
|
| - .setLargeIcon(largeIcon)
|
| - .setTitle("title")
|
| - .setBody("body")
|
| - .setOrigin("origin")
|
| - .setTicker("ticker")
|
| - .setDefaults(Notification.DEFAULT_ALL)
|
| - .setVibrate(new long[] {100L})
|
| - .setContentIntent(contentIntent)
|
| - .setDeleteIntent(deleteIntent)
|
| - .addAction(actionIcon, "button", createIntent(context, "ActionButtonOne"))
|
| - .addAction(actionIcon, "button", createIntent(context, "ActionButtonTwo"))
|
| - .addSettingsAction(
|
| - 0 /* iconId */, "settings", createIntent(context, "SettingsButton"))
|
| - .build();
|
| + Notification notification = new CustomNotificationBuilder(context)
|
| + .setSmallIcon(R.drawable.ic_chrome)
|
| + .setLargeIcon(largeIcon)
|
| + .setTitle("title")
|
| + .setBody("body")
|
| + .setOrigin("origin")
|
| + .setTicker("ticker")
|
| + .setDefaults(Notification.DEFAULT_ALL)
|
| + .setVibrate(new long[] {100L})
|
| + .setContentIntent(contentIntent)
|
| + .setDeleteIntent(deleteIntent)
|
| + .addButtonAction(actionIcon, "button",
|
| + createIntent(context, "ActionButtonOne"))
|
| + .addButtonAction(actionIcon, "button",
|
| + createIntent(context, "ActionButtonTwo"))
|
| + .addSettingsAction(0 /* iconId */, "settings",
|
| + createIntent(context, "SettingsButton"))
|
| + .build();
|
| View compactView = notification.contentView.apply(context, new LinearLayout(context));
|
| View bigView = notification.bigContentView.apply(context, new LinearLayout(context));
|
|
|
| @@ -140,12 +141,12 @@ public class CustomNotificationBuilderTest extends NativeLibraryTestBase {
|
| public void testMaxActionButtons() {
|
| Context context = getInstrumentation().getTargetContext();
|
| NotificationBuilderBase builder = new CustomNotificationBuilder(context)
|
| - .addAction(null /* iconBitmap */, "button",
|
| + .addButtonAction(null /* iconBitmap */, "button",
|
| createIntent(context, "ActionButtonOne"))
|
| - .addAction(null /* iconBitmap */, "button",
|
| + .addButtonAction(null /* iconBitmap */, "button",
|
| createIntent(context, "ActionButtonTwo"));
|
| try {
|
| - builder.addAction(
|
| + builder.addButtonAction(
|
| null /* iconBitmap */, "button", createIntent(context, "ActionButtonThree"));
|
| fail("This statement should not be reached as the previous statement should throw.");
|
| } catch (IllegalStateException e) {
|
| @@ -176,12 +177,12 @@ public class CustomNotificationBuilderTest extends NativeLibraryTestBase {
|
| new int[] {Color.RED}, 1 /* width */, 1 /* height */, Bitmap.Config.ARGB_8888);
|
| actionIcon = actionIcon.copy(Bitmap.Config.ARGB_8888, true /* isMutable */);
|
|
|
| - Notification notification =
|
| - new CustomNotificationBuilder(context)
|
| - .setLargeIcon(largeIcon)
|
| - .setSmallIcon(smallIcon)
|
| - .addAction(actionIcon, "button", createIntent(context, "ActionButton"))
|
| - .build();
|
| + Notification notification = new CustomNotificationBuilder(context)
|
| + .setLargeIcon(largeIcon)
|
| + .setSmallIcon(smallIcon)
|
| + .addButtonAction(actionIcon, "button",
|
| + createIntent(context, "ActionButton"))
|
| + .build();
|
|
|
| // The large icon should not be painted white.
|
| Bitmap notificationLargeIcon =
|
| @@ -224,7 +225,7 @@ public class CustomNotificationBuilderTest extends NativeLibraryTestBase {
|
| .setBody(createString('b', maxLength + 1))
|
| .setOrigin(createString('c', maxLength + 1))
|
| .setTicker(createString('d', maxLength + 1))
|
| - .addAction(null /* iconBitmap */, createString('e', maxLength + 1),
|
| + .addButtonAction(null /* iconBitmap */, createString('e', maxLength + 1),
|
| createIntent(context, "ActionButtonOne"))
|
| .build();
|
| View compactView = notification.contentView.apply(context, new LinearLayout(context));
|
|
|