| Index: content/public/android/java/src/org/chromium/content_public/browser/MediaSessionObserver.java
|
| diff --git a/content/public/android/java/src/org/chromium/content_public/browser/MediaSessionObserver.java b/content/public/android/java/src/org/chromium/content_public/browser/MediaSessionObserver.java
|
| index b6235e3ec13976be7f29a54d5454cbd7e41f8d19..83ecd407a7e7c281ede31c22b07a4921eab308c6 100644
|
| --- a/content/public/android/java/src/org/chromium/content_public/browser/MediaSessionObserver.java
|
| +++ b/content/public/android/java/src/org/chromium/content_public/browser/MediaSessionObserver.java
|
| @@ -23,6 +23,13 @@ public abstract class MediaSessionObserver {
|
| * Construct a MediaSessionObserver and start observing |mediaSession|.
|
| */
|
| protected MediaSessionObserver(MediaSession mediaSession) {
|
| + // In tests, the MediaSession might be a mocked object which is not instance of
|
| + // MediaSessionImpl.
|
| + //
|
| + // TODO(mlamouri): move addObserver()/removeObserver() methods to the {@link MediaSession}
|
| + // class so that we don't need this type check?
|
| + if (!(mediaSession instanceof MediaSessionImpl)) return;
|
| +
|
| mMediaSession = (MediaSessionImpl) mediaSession;
|
| mMediaSession.addObserver(this);
|
| }
|
|
|