#include "components/media_router/common/providers/cast/channel/keep_alive_delegate.h"
#include <stdint.h>
#include <memory>
#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/time/tick_clock.h"
#include "base/timer/mock_timer.h"
#include "base/timer/timer.h"
#include "base/values.h"
#include "components/media_router/common/providers/cast/channel/cast_test_util.h"
#include "net/base/net_errors.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
Sequence;
namespace cast_channel {
namespace {
const int64_t kTestPingTimeoutMillis = …;
const int64_t kTestLivenessTimeoutMillis = …;
CastMessage CreateNonKeepAliveMessage(const std::string& message_type) { … }
class MockTimerWithMonitoredReset : public base::MockRetainingOneShotTimer { … };
class KeepAliveDelegateTest : public testing::Test { … };
TEST_F(KeepAliveDelegateTest, TestErrorHandledBeforeStarting) { … }
TEST_F(KeepAliveDelegateTest, TestPing) { … }
TEST_F(KeepAliveDelegateTest, TestPingFailed) { … }
TEST_F(KeepAliveDelegateTest, TestPingAndLivenessTimeout) { … }
TEST_F(KeepAliveDelegateTest, TestResetTimersAndPassthroughAllOtherTraffic) { … }
TEST_F(KeepAliveDelegateTest, TestPassthroughMessagesAfterError) { … }
TEST_F(KeepAliveDelegateTest, TestLivenessTimerResetAfterSendingMessage) { … }
}
}