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

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

Issue 965573002: Implement support for silent notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos Created 5 years, 10 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/NotificationUIManagerTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationUIManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationUIManagerTest.java
index e1bafb3b1c0c2fa315117819b87f22d4aaf5600b..9d679cbb5f503483d71dbf1ddd78416caa64cdeb 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationUIManagerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationUIManagerTest.java
@@ -148,6 +148,23 @@ public class NotificationUIManagerTest extends ChromeShellTestBase {
}
/**
+ * Verifies that notifications created with the "silent" flag do not inherit system defaults
+ * in regards to their sound, vibration and light indicators.
+ */
+ @MediumTest
+ @Feature({"Browser", "Notifications"})
+ public void testNotificationSilentProperty() throws Exception {
+ setNotificationContentSettingForCurrentOrigin(ContentSetting.ALLOW);
+ assertEquals(PERMISSION_GRANTED, runJavaScriptCodeInCurrentTab("Notification.permission"));
+
+ Notification notification = showAndGetNotification("MyNotification", "{ silent: true }");
+ assertNotNull(notification);
+
+ // Zero indicates that no defaults should be inherit from the system.
Michael van Ouwerkerk 2015/02/27 11:31:21 nit: inherited
Peter Beverloo 2015/02/27 12:26:30 Done.
+ assertEquals(0, notification.defaults);
+ }
+
+ /**
* Verifies that notifications which specify an icon will have that icon fetched, converted into
* a Bitmap and included as the large icon in the notification.
*/

Powered by Google App Engine
This is Rietveld 408576698