chromium/third_party/blink/renderer/core/html/media/video_auto_fullscreen_test.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <memory>

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom-blink.h"
#include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom-blink.h"
#include "third_party/blink/renderer/core/css/css_default_style_sheets.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/html/media/autoplay_policy.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/testing/fake_local_frame_host.h"
#include "third_party/blink/renderer/core/testing/wait_for_event.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/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"

namespace blink {

// Override a FakeLocalFrameHost so that we can enter and exit the fullscreen
// on the appropriate request calls.
class VideoAutoFullscreenFrameHost : public FakeLocalFrameHost {};

class VideoAutoFullscreenFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

class VideoAutoFullscreen : public testing::Test,
                            private ScopedVideoAutoFullscreenForTest {};

TEST_F(VideoAutoFullscreen, PlayTriggersFullscreenWithoutPlaysInline) {}

TEST_F(VideoAutoFullscreen, PlayDoesNotTriggerFullscreenWithPlaysInline) {}

TEST_F(VideoAutoFullscreen, ExitFullscreenPausesWithoutPlaysInline) {}

TEST_F(VideoAutoFullscreen, ExitFullscreenDoesNotPauseWithPlaysInline) {}

// This test is disabled because it requires adding a fake activation in
// production code (crbug.com/1082258).
TEST_F(VideoAutoFullscreen, DISABLED_OnPlayTriggersFullscreenWithoutGesture) {}

}  // namespace blink