| 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();
|
| }
|
|
|
|
|