Chromium Code Reviews| 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 39b2634cd1209709d685f1fd9320cbd659d0add8..e6e12ce0119f5a4210b5498798748582b75ad7fe 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 |
| @@ -26,6 +26,7 @@ import org.chromium.content.browser.test.util.Criteria; |
| import org.chromium.content.browser.test.util.CriteriaHelper; |
| import org.chromium.content.browser.test.util.JavaScriptUtils; |
| +import java.util.Arrays; |
| import java.util.List; |
| import java.util.concurrent.TimeoutException; |
| @@ -371,4 +372,35 @@ public class NotificationUIManagerTest extends ChromeShellTestBase { |
| assertNull(NotificationUIManager.getOriginFromTag( |
| "NotificationUIManager;SystemDownloadNotifier;42")); |
| } |
| + |
| + /** |
| + * Verifies that the makeDefaults method returns the generated notification defaults. |
| + */ |
| + @SmallTest |
| + @Feature({"Browser", "Notifications"}) |
| + public void testMakeDefaults() throws Exception { |
| + // 0 should be returned if silent is true and vibration's length is 0. |
| + assertEquals(0, NotificationUIManager.makeDefaults(0, true)); |
| + |
| + // Notification.DEFAULT_ALL should be returned if silent is false and |
| + // vibration's length is 0. |
| + assertEquals(Notification.DEFAULT_ALL, |
| + NotificationUIManager.makeDefaults(0, false)); |
| + |
| + // Notification.DEFAULT_ALL & ~Notification.DEFAULT_VIBRATE should be returned |
| + // if silent is false and vibration's length is greater than 0. |
| + assertEquals(Notification.DEFAULT_ALL & ~Notification.DEFAULT_VIBRATE, |
| + NotificationUIManager.makeDefaults(10, false)); |
| + } |
| + |
| + /** |
| + * Verifies that the makeVibratePattern method returns vibration pattern used |
| + * in Android notification. |
| + */ |
| + @SmallTest |
| + @Feature({"Browser", "Notifications"}) |
| + public void testMakeVibratePattern() throws Exception { |
| + assertTrue(Arrays.equals(new long[] {0, 100, 200, 300}, |
| + NotificationUIManager.makeVibratePattern(new int[] {100, 200, 300}))); |
|
Peter Beverloo
2015/05/01 17:17:59
You should be able to do this:
import org.junit.A
Sanghyun Park
2015/05/04 07:00:44
Thanks for your information.
Then, as I know, juni
Peter Beverloo
2015/05/05 13:11:56
No need to do that as part of this change.
|
| + } |
| } |