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

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

Issue 2337963003: Plumb through notification action types and placeholders on Android (Closed)
Patch Set: Plumb through the notification action types and placeholder text for inline replies 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/NotificationPlatformBridgeTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java
index d22cfc57b3168cc31aa6936db85bf7588c57076a..ee842d638368956c987072881e9df2e3560f7f04 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.notifications;
import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
+import android.annotation.TargetApi;
import android.app.Notification;
import android.content.Context;
import android.graphics.Bitmap;
@@ -17,7 +18,9 @@ import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
+import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
+import org.chromium.base.test.util.MinAndroidSdkLevel;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.infobar.InfoBar;
@@ -228,6 +231,28 @@ public class NotificationPlatformBridgeTest extends NotificationTestBase {
}
/**
+ * Verifies that notification actions with type: 'text' trigger an inline-reply style
+ * notification.
+ */
+ @CommandLineFlags.Add("enable-experimental-web-platform-features")
+ @MinAndroidSdkLevel(20) // RemoteInputs were only added in API 20.
Peter Beverloo 2016/09/22 18:07:55 Can we use Build.VERSION_CODES.KITKAT_WATCH instea
awdf 2016/09/23 15:24:56 Done.
+ @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
+ @MediumTest
+ @Feature({"Browser", "Notifications"})
+ public void testNotificationInlineReply() throws Exception {
+ loadUrl(getTestServer().getURL(NOTIFICATION_TEST_PAGE));
+ setNotificationContentSettingForCurrentOrigin(ContentSetting.ALLOW);
+
+ Notification notification = showAndGetNotification("MyNotification", "{ "
+ + " actions: [{action: 'myAction', title: 'reply', type: 'text',"
+ + " placeholder: 'hi' }]}");
+ assertNotNull(notification.actions);
+ assertEquals(2, notification.actions.length);
+ Notification.Action action = notification.actions[0];
+ assertNotNull(action.getRemoteInputs());
+ }
+
+ /**
* Verifies that the ONLY_ALERT_ONCE flag is not set when renotify is true.
*/
@MediumTest

Powered by Google App Engine
This is Rietveld 408576698