#include "chrome/browser/media/cast_remoting_connector.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "build/build_config.h"
#include "components/media_router/common/media_route.h"
#include "components/media_router/common/media_source.h"
#include "components/media_router/common/pref_names.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/browser_task_environment.h"
#include "media/mojo/mojom/remoting.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
BrowserThread;
RemotingSinkMetadata;
RemotingSinkMetadataPtr;
RemotingStartFailReason;
RemotingStopReason;
_;
AtLeast;
namespace {
constexpr SessionID kRemotingTabId = …;
RemotingSinkMetadataPtr GetDefaultSinkMetadata() { … }
class MockRemotingSource final : public media::mojom::RemotingSource { … };
class MockMediaRemoter final : public media::mojom::Remoter { … };
}
class CastRemotingConnectorTest : public ::testing::Test { … };
TEST_F(CastRemotingConnectorTest, NeverNotifiesThatSinkIsAvailable) { … }
TEST_F(CastRemotingConnectorTest, NotifiesWhenSinkIsAvailableAndThenGone) { … }
TEST_F(CastRemotingConnectorTest,
NotifiesMultipleSourcesWhenSinkIsAvailableAndThenGone) { … }
TEST_F(CastRemotingConnectorTest, HandlesTeardownOfRemotingSourceFirst) { … }
TEST_F(CastRemotingConnectorTest, HandlesTeardownOfRemoterFirst) { … }
TEST_F(CastRemotingConnectorTest, NoConnectedMediaRemoter) { … }
TEST_F(CastRemotingConnectorTest, UserDisableRemoting) { … }
TEST_F(CastRemotingConnectorTest, NoPermissionToStart) { … }
TEST_F(CastRemotingConnectorTest, PrefPersistsAcrossReset) { … }
namespace {
enum HowItEnds { … };
}
class CastRemotingConnectorFullSessionTest
: public CastRemotingConnectorTest,
public ::testing::WithParamInterface<HowItEnds> { … };
TEST_P(CastRemotingConnectorFullSessionTest, GoesThroughAllTheMotions) { … }
INSTANTIATE_TEST_SUITE_P(…);