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

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

Issue 1388483002: Implement the Notification `timestamp` property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 e68add57df83d26879a1b769295e603b7dad2b67..1c77f6944005a64616af58ab62b817f631d80213 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
@@ -60,6 +60,11 @@ public class NotificationUIManagerTest extends NotificationTestBase {
assertTrue(tickerText.contains("MyNotification"));
assertTrue(tickerText.contains("Hello"));
+ // Verify that the notification's timestamp is set in the past 60 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(Math.abs(System.currentTimeMillis() - notification.when) < 60 * 1000);
+
// Validate the appearance style of the notification. The EXTRA_TEMPLATE was introduced
// in Android Lollipop, we cannot verify this in earlier versions.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP

Powered by Google App Engine
This is Rietveld 408576698