chromium/google_apis/gcm/engine/gcm_store_impl_unittest.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "google_apis/gcm/engine/gcm_store_impl.h"

#include <stdint.h>

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/task_environment.h"
#include "google_apis/gcm/base/fake_encryptor.h"
#include "google_apis/gcm/base/gcm_constants.h"
#include "google_apis/gcm/base/mcs_message.h"
#include "google_apis/gcm/base/mcs_util.h"
#include "google_apis/gcm/protocol/mcs.pb.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace gcm {

namespace {

// Number of persistent ids to use in tests.
const int kNumPersistentIds =;

// Number of per-app messages in tests.
const int kNumMessagesPerApp =;

// App name for testing.
const char kAppName[] =;
const char kAppName2[] =;

// Category name for testing.
const char kCategoryName[] =;

const uint64_t kDeviceId =;
const uint64_t kDeviceToken =;

class GCMStoreImplTest : public testing::Test {};

GCMStoreImplTest::GCMStoreImplTest()
    :{}

GCMStoreImplTest::~GCMStoreImplTest() {}

void GCMStoreImplTest::TearDown() {}

std::unique_ptr<GCMStoreImpl> GCMStoreImplTest::BuildGCMStore() {}

void GCMStoreImplTest::LoadGCMStore(
    GCMStoreImpl* gcm_store,
    std::unique_ptr<GCMStore::LoadResult>* result_dst) {}

std::string GCMStoreImplTest::GetNextPersistentId() {}

void GCMStoreImplTest::PumpLoop() {}

void GCMStoreImplTest::LoadCallback(
    std::unique_ptr<GCMStore::LoadResult>* result_dst,
    std::unique_ptr<GCMStore::LoadResult> result) {}

void GCMStoreImplTest::LoadWithoutCheckCallback(
    std::unique_ptr<GCMStore::LoadResult>* result_dst,
    std::unique_ptr<GCMStore::LoadResult> result) {}

void GCMStoreImplTest::UpdateCallback(bool success) {}

// Verify creating a new database and loading it.
TEST_F(GCMStoreImplTest, LoadNew) {}

// Verify new database is not created when DO_NOT_CREATE is passed.
TEST_F(GCMStoreImplTest, LoadWithoutCreatingNewStore) {}

// Verifies that loads with DO_NOT_CREATE set store_does_not_exist to true when
// an empty directory was left behind after destroying the database.
TEST_F(GCMStoreImplTest, LoadWithEmptyDirectory) {}

TEST_F(GCMStoreImplTest, DeviceCredentials) {}

TEST_F(GCMStoreImplTest, LastCheckinInfo) {}

TEST_F(GCMStoreImplTest, GServicesSettings_ProtocolV2) {}

TEST_F(GCMStoreImplTest, Registrations) {}

// Verify saving some incoming messages, reopening the directory, and then
// removing those incoming messages.
TEST_F(GCMStoreImplTest, IncomingMessages) {}

// Verify saving some incoming messages, reopening the directory after half of
// the TTL and TTL, and then verify expired incoming messages got removed.
TEST_F(GCMStoreImplTest, IncomingMessages_WithTTL) {}

// Verify saving some outgoing messages, reopening the directory, and then
// removing those outgoing messages.
TEST_F(GCMStoreImplTest, OutgoingMessages) {}

// Verify incoming and outgoing messages don't conflict.
TEST_F(GCMStoreImplTest, IncomingAndOutgoingMessages) {}

// Test that per-app message limits are enforced, persisted across restarts,
// and updated as messages are removed.
TEST_F(GCMStoreImplTest, PerAppMessageLimits) {}

TEST_F(GCMStoreImplTest, AccountMapping) {}

TEST_F(GCMStoreImplTest, HeartbeatInterval) {}

// When the database is destroyed, all database updates should fail. At the
// same time, they per-app message counts should not go up, as failures should
// result in decrementing the counts.
TEST_F(GCMStoreImplTest, AddMessageAfterDestroy) {}

TEST_F(GCMStoreImplTest, ReloadAfterClose) {}

TEST_F(GCMStoreImplTest, LastTokenFetchTime) {}

TEST_F(GCMStoreImplTest, InstanceIDData) {}

}  // namespace

}  // namespace gcm