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

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

Issue 2316263002: Notifications in sensitive contexts now display origin + small icon (Closed)
Patch Set: Notifications in sensitive contexts now display origin + small icon Created 4 years, 3 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/CustomNotificationBuilderTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
index ca67eeacb831a8c93e0f4a93109d070455d14071..b22886ff1e9d8fb2559f0e4c1f02f09ef66e0f83 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
@@ -74,6 +74,9 @@ public class CustomNotificationBuilderTest extends NativeLibraryTestBase {
.addAction(actionIcon, "button", createIntent(context, "ActionButtonTwo"))
.addSettingsAction(
0 /* iconId */, "settings", createIntent(context, "SettingsButton"))
+ .setPublicVersion(new CustomNotificationBuilder(context)
Peter Beverloo 2016/09/09 12:53:31 Mm. This reads a bit odd since we don't use a cust
awdf 2016/09/09 15:55:26 Oops that was just leftover from before I switched
+ .setTitle("public title")
+ .build())
.build();
View compactView = notification.contentView.apply(context, new LinearLayout(context));
View bigView = notification.bigContentView.apply(context, new LinearLayout(context));
@@ -101,6 +104,13 @@ public class CustomNotificationBuilderTest extends NativeLibraryTestBase {
assertSame(contentIntent, notification.contentIntent);
assertSame(deleteIntent, notification.deleteIntent);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ // Notification.publicVersion was added in Android L.
+ assertNotNull(notification.publicVersion);
+ assertEquals(
+ "public title", NotificationTestUtil.getExtraTitle(notification.publicVersion));
+ }
+
// The regular actions and the settings action are added together in the notification
// actions array, so they can be exposed on e.g. Wear and custom lockscreens.
assertEquals(3, NotificationTestUtil.getActions(notification).length);

Powered by Google App Engine
This is Rietveld 408576698