#include "chrome/browser/media/router/providers/cast/cast_internal_message_util.h"
#include "base/json/json_reader.h"
#include "base/test/gtest_util.h"
#include "build/build_config.h"
#include "chrome/browser/media/router/test/provider_test_helpers.h"
#include "components/media_router/common/providers/cast/channel/cast_test_util.h"
#include "components/media_router/common/test/test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
IsJson;
ParseJson;
ParseJsonDict;
namespace media_router {
namespace {
static constexpr char kReceiverIdToken[] = …;
base::Value::Dict ReceiverStatus() { … }
base::Value::Dict ReceiverStatusWithUniversalAppId() { … }
void ExpectNoCastSession(const MediaSinkInternal& sink,
const std::string& receiver_status_str,
const std::string& reason) { … }
void ExpectInvalidCastInternalMessage(const std::string& message_str,
const std::string& invalid_reason) { … }
class CastInternalMessageUtilDeathTest : public testing::Test { … };
}
#if BUILDFLAG(IS_WIN)
#define MAYBE_CastInternalMessageFromAppMessageString …
#else
#define MAYBE_CastInternalMessageFromAppMessageString …
#endif
TEST_F(CastInternalMessageUtilDeathTest,
MAYBE_CastInternalMessageFromAppMessageString) { … }
TEST_F(CastInternalMessageUtilDeathTest,
CastInternalMessageFromV2MessageString) { … }
#if BUILDFLAG(IS_WIN) && !defined(NDEBUG) || BUILDFLAG(IS_LINUX)
#define MAYBE_CastInternalMessageFromClientConnectString …
#else
#define MAYBE_CastInternalMessageFromClientConnectString …
#endif
TEST_F(CastInternalMessageUtilDeathTest,
MAYBE_CastInternalMessageFromClientConnectString) { … }
TEST(CastInternalMessageUtilTest, CastInternalMessageFromInvalidStrings) { … }
TEST(CastInternalMessageUtilTest, CastSessionFromReceiverStatusNoStatusText) { … }
TEST(CastInternalMessageUtilTest, CastSessionFromInvalidReceiverStatuses) { … }
TEST(CastInternalMessageUtilTest, CreateReceiverActionCastMessage) { … }
TEST(CastInternalMessageUtilTest, CreateReceiverActionStopMessage) { … }
TEST(CastInternalMessageUtilTest, CreateNewSessionMessage) { … }
TEST(CastInternalMessageUtilTest, CreateNewSessionMessageWithUniversalAppId) { … }
TEST(CastInternalMessageUtilTest, CreateUpdateSessionMessage) { … }
TEST(CastInternalMessageUtilTest, CreateAppMessageAck) { … }
TEST(CastInternalMessageUtilTest, CreateAppMessage) { … }
TEST(CastInternalMessageUtilTest, CreateV2Message) { … }
TEST(CastInternalMessageUtilTest, SupportedMediaCommandsToListValue) { … }
}