chromium/content/browser/media/session/media_session_controller_unittest.cc

// Copyright 2016 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 <tuple>

#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "content/browser/media/media_web_contents_observer.h"
#include "content/browser/media/session/audio_focus_delegate.h"
#include "content/browser/media/session/media_session_controller.h"
#include "content/browser/media/session/media_session_impl.h"
#include "content/public/browser/media_device_id.h"
#include "content/test/mock_agent_scheduling_group_host.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "media/audio/audio_device_description.h"
#include "media/mojo/mojom/media_player.mojom.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace content {

class FakeAudioFocusDelegate : public content::AudioFocusDelegate {};

// Helper class that provides an implementation of the media::mojom::MediaPlayer
// mojo interface to allow checking that messages sent over mojo are received
// with the right values in the other end.
//
// Note this relies on MediaSessionController::BindMediaPlayer() to provide the
// MediaSessionController instance owned by the test with a valid mojo remote,
// that will be bound to the mojo receiver provided by this class instead of the
// real one used in production which would be owned by HTMLMediaElement instead.
class TestMediaPlayer : public media::mojom::MediaPlayer {};

// Helper class to mock `RequestVisibility` callbacks.
class RequestVisibilityWaiter {};

class MediaSessionControllerTest : public RenderViewHostImplTestHarness {};

TEST_F(MediaSessionControllerTest, NoAudioNoSession) {}

TEST_F(MediaSessionControllerTest, TransientNoControllableSession) {}

TEST_F(MediaSessionControllerTest, BasicControls) {}

TEST_F(MediaSessionControllerTest, VolumeMultiplier) {}

TEST_F(MediaSessionControllerTest, ControllerSidePause) {}

TEST_F(MediaSessionControllerTest, Reinitialize) {}

TEST_F(MediaSessionControllerTest, PositionState) {}

TEST_F(MediaSessionControllerTest, RemovePlayerIfSessionReset) {}

TEST_F(MediaSessionControllerTest, PictureInPictureAvailability) {}

TEST_F(MediaSessionControllerTest, SufficientlyVisibleVideo) {}

TEST_F(MediaSessionControllerTest, RequestVisibility) {}

TEST_F(MediaSessionControllerTest, AudioOutputSinkIdChange) {}

TEST_F(MediaSessionControllerTest, AddPlayerWhenUnmuted) {}

TEST_F(MediaSessionControllerTest, RemovePlayerWhenMuted) {}

TEST_F(MediaSessionControllerTest, EnterLeavePictureInPictureMuted) {}

TEST_F(MediaSessionControllerTest, MuteWithPictureInPicture) {}

TEST_F(MediaSessionControllerTest, LeavePictureInPictureUnmuted) {}

TEST_F(MediaSessionControllerTest, AddPlayerWhenAddingAudio) {}

TEST_F(MediaSessionControllerTest,
       AddPlayerWhenEnteringPictureInPictureWithNoAudio) {}

TEST_F(MediaSessionControllerTest,
       AddPlayerWhenEnteringPictureInPicturePaused) {}

TEST_F(MediaSessionControllerTest,
       AddPlayerInitiallyPictureInPictureWithNoAudio) {}

TEST_F(MediaSessionControllerTest,
       AddPlayerWhenStartingRemotePlaybackWithNoAudio) {}

TEST_F(MediaSessionControllerTest, EndOfPlaybackWithInPictureInPicture) {}

TEST_F(MediaSessionControllerTest, HasVideo_True) {}

TEST_F(MediaSessionControllerTest, HasVideo_False) {}

TEST_F(MediaSessionControllerTest, AudioFocusRequestFailure) {}

TEST_F(MediaSessionControllerTest, SetAudioSinkId) {}

}  // namespace content