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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java

Issue 2833583004: [Android] Log notification shown/blocked for all other notifications (Closed)
Patch Set: Verify media notifications not logged in other test cases Created 3 years, 8 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/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java b/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java
index ab19b76c6ee1c779cc98260de27c5f23a72fd19a..190e5f44138ec4ec6834a28b39bb4b26aad8ee18 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java
@@ -35,6 +35,7 @@ import org.chromium.base.ContextUtils;
import org.chromium.chrome.browser.AppHooks;
import org.chromium.chrome.browser.AppHooksImpl;
import org.chromium.chrome.browser.media.ui.MediaNotificationManager.ListenerService;
+import org.chromium.chrome.browser.notifications.NotificationUmaTracker;
import org.chromium.content_public.common.MediaMetadata;
import java.util.concurrent.TimeUnit;
@@ -49,12 +50,13 @@ public class MediaNotificationManagerTestBase {
MockListenerService mService;
MediaNotificationListener mListener;
AppHooksImpl mMockAppHooks;
+ NotificationUmaTracker mMockUmaTracker;
MediaNotificationInfo.Builder mMediaNotificationInfoBuilder;
static class MockMediaNotificationManager extends MediaNotificationManager {
- public MockMediaNotificationManager(int notificationId) {
- super(notificationId);
+ public MockMediaNotificationManager(NotificationUmaTracker umaTracker, int notificationId) {
+ super(umaTracker, notificationId);
}
}
@@ -93,8 +95,9 @@ public class MediaNotificationManagerTestBase {
new MediaNotificationManager.NotificationOptions(MockListenerService.class,
MockMediaButtonReceiver.class, NOTIFICATION_GROUP_NAME));
- MediaNotificationManager.setManagerForTesting(
- getNotificationId(), spy(new MockMediaNotificationManager(getNotificationId())));
+ mMockUmaTracker = mock(NotificationUmaTracker.class);
+ MediaNotificationManager.setManagerForTesting(getNotificationId(),
+ spy(new MockMediaNotificationManager(mMockUmaTracker, getNotificationId())));
mMediaNotificationInfoBuilder =
new MediaNotificationInfo.Builder()
@@ -148,6 +151,7 @@ public class MediaNotificationManagerTestBase {
clearInvocations(getManager());
clearInvocations(mService);
clearInvocations(mMockContext);
+ clearInvocations(mMockUmaTracker);
}
void setUpService() {

Powered by Google App Engine
This is Rietveld 408576698