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

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

Issue 2337963003: Plumb through notification action types and placeholders on Android (Closed)
Patch Set: Created 4 years, 3 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 474c37ba455f9e8fe566906f3c821c831834e1e2..2a3614fb7256ce4c9c242fb8595387f84e71dcf5 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
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.notifications;
import android.app.Notification;
import android.app.PendingIntent;
+import android.app.RemoteInput;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
@@ -157,4 +158,24 @@ public class StandardNotificationBuilderTest extends InstrumentationTestCase {
assertTrue(expected.sameAs(result));
}
}
+
+ @SmallTest
+ @Feature({"Browser", "Notifications"})
+ public void testSetActionWithRemoteInput() {
awdf 2016/09/13 14:14:55 is there any way to make a test run only on certai
Peter Beverloo 2016/09/14 16:27:12 @MinAndroidSdkLevel
awdf 2016/09/22 14:17:11 Done.
+ Context context = getInstrumentation().getTargetContext();
+ NotificationBuilderBase notificationBuilder = new StandardNotificationBuilder(context);
+
+ RemoteInput remoteInput = null;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
+ remoteInput =
+ new RemoteInput.Builder("key_text_reply").setLabel("Placeholder text").build();
+ }
+ notificationBuilder.addAction(null, "title", null, remoteInput);
+
+ Notification notification = notificationBuilder.build();
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
+ assertEquals(remoteInput, notification.actions[0].getRemoteInputs()[0]);
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698