#include "google_apis/gcm/engine/heartbeat_manager.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "google_apis/gcm/protocol/mcs.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gcm {
namespace {
mcs_proto::HeartbeatConfig BuildHeartbeatConfig(int interval_ms) { … }
class TestHeartbeatManager : public HeartbeatManager { … };
void TestHeartbeatManager::TriggerHearbeat() { … }
void TestHeartbeatManager::TriggerMissedHeartbeatCheck() { … }
class HeartbeatManagerTest : public testing::Test { … };
HeartbeatManagerTest::HeartbeatManagerTest()
: … { … }
void HeartbeatManagerTest::StartManager() { … }
void HeartbeatManagerTest::SendHeartbeatClosure() { … }
void HeartbeatManagerTest::TriggerReconnectClosure(
ConnectionFactory::ConnectionResetReason reason) { … }
TEST_F(HeartbeatManagerTest, Init) { … }
TEST_F(HeartbeatManagerTest, AckBeforeStart) { … }
TEST_F(HeartbeatManagerTest, Start) { … }
TEST_F(HeartbeatManagerTest, AckedHeartbeat) { … }
TEST_F(HeartbeatManagerTest, UnackedHeartbeat) { … }
TEST_F(HeartbeatManagerTest, UpdateIntervalThenStart) { … }
TEST_F(HeartbeatManagerTest, StartThenUpdateInterval) { … }
TEST_F(HeartbeatManagerTest, Stop) { … }
TEST_F(HeartbeatManagerTest, MissedHeartbeat) { … }
TEST_F(HeartbeatManagerTest, SetClientHeartbeatInterval) { … }
TEST_F(HeartbeatManagerTest, ClientIntervalInvalid) { … }
TEST_F(HeartbeatManagerTest, ClientIntervalAfterHeartbeatTriggered) { … }
}
}