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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/media/remote/CastStartStopTest.java

Issue 1652163002: Refactor Clank cast code to use MediaNotificationManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@MediaUi
Patch Set: Respond to final batch of nits Created 4 years, 10 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/remote/CastStartStopTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/media/remote/CastStartStopTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/media/remote/CastStartStopTest.java
index cd4c7ead088d96315c21b1db5bd60693f3e09e00..7ed5f68e65fbfaace66f76b372097511f395b827 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/media/remote/CastStartStopTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/media/remote/CastStartStopTest.java
@@ -4,12 +4,12 @@
package org.chromium.chrome.browser.media.remote;
-import android.app.PendingIntent.CanceledException;
import android.graphics.Rect;
import android.test.suitebuilder.annotation.LargeTest;
+import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
-import org.chromium.chrome.browser.media.remote.NotificationTransportControl.ListenerService;
+import org.chromium.chrome.browser.media.ui.MediaNotificationListener;
import org.chromium.chrome.browser.tab.Tab;
import java.util.concurrent.TimeoutException;
@@ -54,19 +54,15 @@ public class CastStartStopTest extends CastTestBase {
castDefaultVideoFromPage(DEFAULT_VIDEO_PAGE);
// Get the notification
- NotificationTransportControl notificationTransportControl = waitForCastNotification();
-
- // We can't actually click the notification's stop button, since it is owned by a different
- // process and hence is not accessible through instrumentation, so send the stop event
- // instead.
- NotificationTransportControl.ListenerService service =
- waitForCastNotificationService(notificationTransportControl);
-
- try {
- service.getPendingIntent(ListenerService.ACTION_ID_STOP).send();
- } catch (CanceledException e) {
- fail();
- }
+ final CastNotificationControl notificationControl = waitForCastNotification();
+
+ // Send play
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ notificationControl.onStop(MediaNotificationListener.ACTION_SOURCE_MEDIA_SESSION);
+ }
+ });
checkDisconnected();
}

Powered by Google App Engine
This is Rietveld 408576698