#include "third_party/blink/renderer/modules/media_controls/media_controls_rotate_to_fullscreen_delegate.h"
#include <tuple>
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "services/device/public/mojom/screen_orientation.mojom-blink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/css/css_style_declaration.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/html/media/html_audio_element.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/modules/device_orientation/device_orientation_controller.h"
#include "third_party/blink/renderer/modules/device_orientation/device_orientation_data.h"
#include "third_party/blink/renderer/modules/media_controls/media_controls_impl.h"
#include "third_party/blink/renderer/modules/screen_orientation/screen_orientation_controller.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/empty_web_media_player.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "ui/display/mojom/screen_orientation.mojom-blink.h"
namespace blink {
namespace {
class MockVideoWebMediaPlayer : public EmptyWebMediaPlayer { … };
class MockChromeClient : public EmptyChromeClient { … };
class StubLocalFrameClient : public EmptyLocalFrameClient { … };
}
class MediaControlsRotateToFullscreenDelegateTest
: public PageTestBase,
private ScopedVideoFullscreenOrientationLockForTest,
private ScopedVideoRotateToFullscreenForTest { … };
void MediaControlsRotateToFullscreenDelegateTest::InitScreenAndVideo(
display::mojom::blink::ScreenOrientation initial_screen_orientation,
gfx::Size video_size,
bool with_device_orientation ) { … }
void MediaControlsRotateToFullscreenDelegateTest::PlayVideo() { … }
void MediaControlsRotateToFullscreenDelegateTest::RotateTo(
display::mojom::blink::ScreenOrientation new_screen_orientation) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, DelegateRequiresFlag) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, DelegateRequiresVideo) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, ComputeVideoOrientation) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
OnlyObserveVisibilityWhenPlaying) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterSuccessPortraitToLandscape) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterSuccessLandscapeToPortrait) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterSuccessSquarePortraitToLandscape) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, EnterFailWrongOrientation) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterFailSquareWrongOrientation) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, EnterFailNoControls) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterFailNoDeviceOrientation) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterFailZeroDeviceOrientation) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, EnterFailPaused) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, EnterFailHidden) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterFail180DegreeRotation) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, EnterFailSmall) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterFailDocumentFullscreen) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
ExitSuccessLandscapeFullscreenToPortraitInline) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
ExitSuccessPortraitFullscreenToLandscapeInline) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
ExitFailDocumentFullscreen) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterFailControlsListNoFullscreen) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest, EnterFailPictureInPicture) { … }
TEST_F(MediaControlsRotateToFullscreenDelegateTest,
EnterSuccessControlsListNoDownload) { … }
}