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

Unified Diff: third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetectorTest.cpp

Issue 2738893002: Add flag for enabling/disabling video fullscreen detection (Closed)
Patch Set: rebased Created 3 years, 9 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: third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetectorTest.cpp
diff --git a/third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetectorTest.cpp b/third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetectorTest.cpp
index 9da6eecebef2ea5526cc9fafe66f85c41a25b055..0f78b0034413eb98521a5abb0f9633b047830f18 100644
--- a/third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetectorTest.cpp
+++ b/third_party/WebKit/Source/core/html/MediaCustomControlsFullscreenDetectorTest.cpp
@@ -7,6 +7,7 @@
#include "core/EventTypeNames.h"
#include "core/html/HTMLVideoElement.h"
#include "core/testing/DummyPageHolder.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/geometry/IntRect.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -25,6 +26,11 @@ struct TestParam {
class MediaCustomControlsFullscreenDetectorTest : public ::testing::Test {
protected:
void SetUp() override {
+ m_originalVideoFullscreenDetectionEnabled =
+ RuntimeEnabledFeatures::videoFullscreenDetectionEnabled();
+
+ RuntimeEnabledFeatures::setVideoFullscreenDetectionEnabled(true);
+
m_pageHolder = DummyPageHolder::create();
m_newPageHolder = DummyPageHolder::create();
@@ -32,6 +38,11 @@ class MediaCustomControlsFullscreenDetectorTest : public ::testing::Test {
document().body()->appendChild(&videoElement());
}
+ void TearDown() override {
+ RuntimeEnabledFeatures::setVideoFullscreenDetectionEnabled(
+ m_originalVideoFullscreenDetectionEnabled);
+ }
+
HTMLVideoElement& videoElement() const { return *m_video; }
MediaCustomControlsFullscreenDetector& fullscreenDetector() const {
return *videoElement().m_customControlsFullscreenDetector;
@@ -65,6 +76,8 @@ class MediaCustomControlsFullscreenDetectorTest : public ::testing::Test {
std::unique_ptr<DummyPageHolder> m_pageHolder;
std::unique_ptr<DummyPageHolder> m_newPageHolder;
Persistent<HTMLVideoElement> m_video;
+
+ bool m_originalVideoFullscreenDetectionEnabled;
};
TEST_F(MediaCustomControlsFullscreenDetectorTest, computeIsDominantVideo) {

Powered by Google App Engine
This is Rietveld 408576698