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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationTitleUpdatedTest.java

Issue 2439483003: Link MediaSessionTabHelper with native MediaSession [CL is going to be split] (Closed)
Patch Set: addressed comments Created 4 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/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..2a81c352d4f1d52068c9baf08a252acac5e6b3b7 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;
@@ -24,7 +23,6 @@ import org.chromium.chrome.test.util.browser.TabTitleObserver;
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 +148,9 @@ 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);
- }
+ MediaSessionTabHelper.getHelperFromTabForTesting(tab)
+ .getMediaSessionDelegateForTesting()
+ .mediaSessionStateChanged(isControllable, isSuspended);
}
});
}
@@ -163,11 +159,9 @@ 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);
- }
+ MediaSessionTabHelper.getHelperFromTabForTesting(tab)
+ .getMediaSessionDelegateForTesting()
+ .mediaSessionMetadataChanged(metadata);
}
});
}

Powered by Google App Engine
This is Rietveld 408576698