| Index: third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp
|
| index 31eeadba24631944984dc8d694db43e94a9f8d7c..bf8010aefc4beec050a96b585a3dfd2898b0c7b1 100644
|
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp
|
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp
|
| @@ -17,6 +17,7 @@
|
| #include "platform/testing/UnitTestHelpers.h"
|
| #include "public/platform/WebMediaPlayer.h"
|
| #include "public/platform/WebSize.h"
|
| +#include "public/platform/modules/remoteplayback/WebRemotePlaybackClient.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include <memory>
|
|
|
| @@ -61,6 +62,20 @@ class MockVideoWebMediaPlayer : public WebMediaPlayer {
|
| void paint(WebCanvas*, const WebRect&, SkPaint&) override{};
|
| };
|
|
|
| +class MockWebRemotePlaybackClient : public WebRemotePlaybackClient {
|
| + public:
|
| + void stateChanged(WebRemotePlaybackState) override {}
|
| + void availabilityChanged(bool isRouteAvailable,
|
| + bool isSourceCompatible) override {
|
| + m_availability = isRouteAvailable && isSourceCompatible;
|
| + }
|
| + void promptCancelled() override {}
|
| + bool remotePlaybackAvailable() const override { return m_availability; }
|
| +
|
| + private:
|
| + bool m_availability = false;
|
| +};
|
| +
|
| class StubFrameLoaderClient : public EmptyFrameLoaderClient {
|
| public:
|
| static StubFrameLoaderClient* create() { return new StubFrameLoaderClient; }
|
| @@ -71,6 +86,12 @@ class StubFrameLoaderClient : public EmptyFrameLoaderClient {
|
| WebMediaPlayerClient*) override {
|
| return wrapUnique(new MockVideoWebMediaPlayer);
|
| }
|
| +
|
| + WebRemotePlaybackClient* createWebRemotePlaybackClient(
|
| + HTMLMediaElement&,
|
| + ScriptState*) override {
|
| + return new MockWebRemotePlaybackClient;
|
| + }
|
| };
|
|
|
| Element* getElementByShadowPseudoId(Node& rootNode,
|
| @@ -124,7 +145,7 @@ class MediaControlsTest : public ::testing::Test {
|
| }
|
|
|
| void simulateRouteAvailabe() {
|
| - m_mediaControls->mediaElement().remoteRouteAvailabilityChanged(true);
|
| + m_mediaControls->mediaElement().remoteRouteAvailabilityChanged(true, true);
|
| }
|
|
|
| void ensureLayout() {
|
|
|