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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp

Issue 2480003002: [RemotePlayback] Keep track of source compatibility and reject prompt() correspondingly (Closed)
Patch Set: Fixed the java enum comment Created 4 years, 1 month 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: 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 303eb67fe618ad8628f1ef6dcecc743e6341db81..cea984fc9993b8a25da473c05bce74afe8ddded6 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/WebRemotePlaybackAvailability.h"
#include "public/platform/modules/remoteplayback/WebRemotePlaybackClient.h"
#include "testing/gtest/include/gtest/gtest.h"
#include <memory>
@@ -62,6 +63,23 @@ class MockVideoWebMediaPlayer : public WebMediaPlayer {
void paint(WebCanvas*, const WebRect&, SkPaint&) override{};
};
+class MockWebRemotePlaybackClient : public WebRemotePlaybackClient {
+ public:
+ void stateChanged(WebRemotePlaybackState) override {}
+ void availabilityChanged(
+ WebRemotePlaybackAvailability availability) override {
+ m_availability = availability;
+ }
+ void promptCancelled() override {}
+ bool remotePlaybackAvailable() const override {
+ return m_availability == WebRemotePlaybackAvailability::DeviceAvailable;
+ }
+
+ private:
+ WebRemotePlaybackAvailability m_availability =
+ WebRemotePlaybackAvailability::Unknown;
+};
+
class StubFrameLoaderClient : public EmptyFrameLoaderClient {
public:
static StubFrameLoaderClient* create() { return new StubFrameLoaderClient; }
@@ -72,6 +90,17 @@ class StubFrameLoaderClient : public EmptyFrameLoaderClient {
WebMediaPlayerClient*) override {
return wrapUnique(new MockVideoWebMediaPlayer);
}
+
+ WebRemotePlaybackClient* createWebRemotePlaybackClient(
+ HTMLMediaElement&) override {
+ if (!m_remotePlaybackClient) {
+ m_remotePlaybackClient = wrapUnique(new MockWebRemotePlaybackClient);
+ }
+ return m_remotePlaybackClient.get();
+ }
+
+ private:
+ std::unique_ptr<MockWebRemotePlaybackClient> m_remotePlaybackClient;
};
Element* getElementByShadowPseudoId(Node& rootNode,
@@ -125,7 +154,8 @@ class MediaControlsTest : public ::testing::Test {
}
void simulateRouteAvailabe() {
- m_mediaControls->mediaElement().remoteRouteAvailabilityChanged(true);
+ m_mediaControls->mediaElement().remoteRouteAvailabilityChanged(
+ WebRemotePlaybackAvailability::DeviceAvailable);
}
void ensureLayout() {
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.cpp ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698