| 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 2907989b32640844447a36417c72e598764a0d02..3491d8a90ee1f91bff3e3e14d29b0d905978d16e 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
|
| @@ -62,8 +62,10 @@ public class CustomNotificationBuilderTest extends InstrumentationTestCase {
|
| .setVibrate(new long[] {100L})
|
| .setContentIntent(contentIntent)
|
| .setDeleteIntent(deleteIntent)
|
| - .addAction(actionIcon, "button", createIntent(context, "ActionButtonOne"))
|
| - .addAction(actionIcon, "button", createIntent(context, "ActionButtonTwo"))
|
| + .addAction(ButtonInfoType.BUTTON, actionIcon, "button",
|
| + null /* placeholder */, createIntent(context, "ActionButtonOne"))
|
| + .addAction(ButtonInfoType.BUTTON, actionIcon, "button",
|
| + null /* placeholder */, createIntent(context, "ActionButtonTwo"))
|
| .addSettingsAction(
|
| 0 /* iconId */, "settings", createIntent(context, "SettingsButton"))
|
| .build();
|
| @@ -116,14 +118,15 @@ public class CustomNotificationBuilderTest extends InstrumentationTestCase {
|
| @Feature({"Browser", "Notifications"})
|
| public void testMaxActionButtons() {
|
| Context context = getInstrumentation().getTargetContext();
|
| - NotificationBuilderBase builder = new CustomNotificationBuilder(context)
|
| - .addAction(null /* iconBitmap */, "button",
|
| - createIntent(context, "ActionButtonOne"))
|
| - .addAction(null /* iconBitmap */, "button",
|
| - createIntent(context, "ActionButtonTwo"));
|
| + NotificationBuilderBase builder =
|
| + new CustomNotificationBuilder(context)
|
| + .addAction(ButtonInfoType.BUTTON, null /* iconBitmap */, "button",
|
| + null /* placeholder */, createIntent(context, "ActionButtonOne"))
|
| + .addAction(ButtonInfoType.BUTTON, null /* iconBitmap */, "button",
|
| + null /* placeholder */, createIntent(context, "ActionButtonTwo"));
|
| try {
|
| - builder.addAction(
|
| - null /* iconBitmap */, "button", createIntent(context, "ActionButtonThree"));
|
| + builder.addAction(ButtonInfoType.BUTTON, null /* iconBitmap */, "button",
|
| + null /* placeholder */, createIntent(context, "ActionButtonThree"));
|
| fail("This statement should not be reached as the previous statement should throw.");
|
| } catch (IllegalStateException e) {
|
| assertEquals("Cannot add more than 2 actions.", e.getMessage());
|
| @@ -157,7 +160,8 @@ public class CustomNotificationBuilderTest extends InstrumentationTestCase {
|
| new CustomNotificationBuilder(context)
|
| .setLargeIcon(largeIcon)
|
| .setSmallIcon(smallIcon)
|
| - .addAction(actionIcon, "button", createIntent(context, "ActionButton"))
|
| + .addAction(ButtonInfoType.BUTTON, actionIcon, "button",
|
| + null /* placeholder */, createIntent(context, "ActionButton"))
|
| .build();
|
|
|
| // The large icon should not be painted white.
|
| @@ -198,7 +202,8 @@ public class CustomNotificationBuilderTest extends InstrumentationTestCase {
|
| .setBody(createString('b', maxLength + 1))
|
| .setOrigin(createString('c', maxLength + 1))
|
| .setTicker(createString('d', maxLength + 1))
|
| - .addAction(null /* iconBitmap */, createString('e', maxLength + 1),
|
| + .addAction(ButtonInfoType.BUTTON, null /* iconBitmap */,
|
| + createString('e', maxLength + 1), null /* placeholder */,
|
| createIntent(context, "ActionButtonOne"))
|
| .build();
|
| View compactView = notification.contentView.apply(context, new LinearLayout(context));
|
|
|