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 792375e2bb46237b5a64c3c747622fcbe32c5ced..7d67124b61524ec0d61c3cd90b4c79021891ef67 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 |
| @@ -165,6 +165,11 @@ public class NotificationUIManagerTest extends ChromeActivityTestCaseBase<Chrome |
| assertTrue(tickerText.contains("MyNotification")); |
| assertTrue(tickerText.contains("Hello")); |
| + // Verify that the notification's timestamp is set in the past 30 seconds. This number has |
| + // no significance, but needs to be high enough to not cause flakiness as it's set by the |
| + // renderer process on notification creation. |
| + assertTrue((System.currentTimeMillis() - notification.when) < 30 * 1000); |
|
johnme
2015/10/20 17:12:20
Is it worth throwing in a Math.abs just in case th
Peter Beverloo
2016/01/28 17:18:29
Done.
|
| + |
| // Validate the appearance style of the notification. The EXTRA_TEMPLATE was inroduced |
| // in Android Lollipop, we cannot verify this in earlier versions. |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |