Index: chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationTitleUpdatedTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationTitleUpdatedTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationTitleUpdatedTest.java |
index 2720de1e540665438bfceda326ea41156bdd8ae9..8b20b483823329185faa61164f731a693a0e3fcb 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationTitleUpdatedTest.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationTitleUpdatedTest.java |
@@ -11,7 +11,6 @@ import android.test.suitebuilder.annotation.SmallTest; |
import android.view.View; |
import android.widget.TextView; |
-import org.chromium.base.ObserverList; |
import org.chromium.base.ThreadUtils; |
import org.chromium.base.test.util.Restriction; |
import org.chromium.base.test.util.RetryOnFailure; |
@@ -21,10 +20,10 @@ import org.chromium.chrome.browser.tab.Tab; |
import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
import org.chromium.chrome.test.util.ChromeRestriction; |
import org.chromium.chrome.test.util.browser.TabTitleObserver; |
+import org.chromium.content.browser.ChromeMediaSession; |
import org.chromium.content.browser.test.util.Criteria; |
import org.chromium.content.browser.test.util.CriteriaHelper; |
import org.chromium.content.browser.test.util.JavaScriptUtils; |
-import org.chromium.content_public.browser.WebContentsObserver; |
import org.chromium.content_public.common.MediaMetadata; |
/** |
@@ -150,11 +149,8 @@ public class NotificationTitleUpdatedTest extends ChromeActivityTestCaseBase<Chr |
ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
@Override |
public void run() { |
- ObserverList.RewindableIterator<WebContentsObserver> observers = |
- tab.getWebContents().getObserversForTesting(); |
- while (observers.hasNext()) { |
- observers.next().mediaSessionStateChanged(isControllable, isSuspended); |
- } |
+ ChromeMediaSession.fromWebContents(tab.getWebContents()) |
+ .mediaSessionStateChanged(isControllable, isSuspended); |
} |
}); |
} |
@@ -163,11 +159,8 @@ public class NotificationTitleUpdatedTest extends ChromeActivityTestCaseBase<Chr |
ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
@Override |
public void run() { |
- ObserverList.RewindableIterator<WebContentsObserver> observers = |
- tab.getWebContents().getObserversForTesting(); |
- while (observers.hasNext()) { |
- observers.next().mediaSessionMetadataChanged(metadata); |
- } |
+ ChromeMediaSession.fromWebContents(tab.getWebContents()) |
+ .mediaSessionMetadataChanged(metadata); |
} |
}); |
} |