#include "content/browser/media/session/media_session_service_impl.h"
#include <memory>
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "content/browser/media/session/media_session_impl.h"
#include "content/browser/media/session/media_session_player_observer.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/shell/browser/shell.h"
#include "media/base/media_content_type.h"
#include "services/media_session/public/cpp/test/mock_media_session.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace {
class NavigationWatchingWebContentsObserver : public WebContentsObserver { … };
class MockMediaSessionPlayerObserver : public MediaSessionPlayerObserver { … };
void NavigateToURLAndWaitForFinish(Shell* window, const GURL& url) { … }
char kSetUpMediaSessionScript[] = …;
char kSetUpWebRTCMediaSessionScript[] = …;
const int kPlayerId = …;
}
class MediaSessionServiceImplBrowserTest : public ContentBrowserTest { … };
IN_PROC_BROWSER_TEST_F(MediaSessionServiceImplBrowserTest,
CrashMessageOnUnload) { … }
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || \
BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
#define MAYBE_ResetServiceWhenNavigatingAway …
#else
#define MAYBE_ResetServiceWhenNavigatingAway …
#endif
IN_PROC_BROWSER_TEST_F(MediaSessionServiceImplBrowserTest,
MAYBE_ResetServiceWhenNavigatingAway) { … }
IN_PROC_BROWSER_TEST_F(MediaSessionServiceImplBrowserTest,
DISABLED_DontResetServiceForSameDocumentNavigation) { … }
IN_PROC_BROWSER_TEST_F(MediaSessionServiceImplBrowserTest,
MicrophoneAndCameraStatesInitiallyUnknown) { … }
IN_PROC_BROWSER_TEST_F(MediaSessionServiceImplBrowserTest,
MicrophoneAndCameraStatesCanBeSet) { … }
}