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

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 5 years, 2 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 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) {

Powered by Google App Engine
This is Rietveld 408576698