Chromium Code Reviews| 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]); |
| + } |
| + } |
| } |