#include "components/metrics/unsent_log_store.h"
#include <stddef.h>
#include <limits>
#include "base/base64.h"
#include "base/hash/sha1.h"
#include "base/rand_util.h"
#include "base/values.h"
#include "components/metrics/unsent_log_store_metrics_impl.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/zlib/google/compression_utils.h"
namespace metrics {
namespace {
const char kTestPrefName[] = …;
const char kTestMetaDataPrefName[] = …;
const size_t kLogCountLimit = …;
const size_t kLogByteLimit = …;
std::string Compress(const std::string& log_data) { … }
std::string GenerateLogWithMinCompressedSize(size_t min_compressed_size) { … }
class UnsentLogStoreTest : public testing::Test { … };
class TestUnsentLogStoreMetrics : public UnsentLogStoreMetrics { … };
class TestUnsentLogStore : public UnsentLogStore { … };
}
TEST_F(UnsentLogStoreTest, EmptyLogList) { … }
TEST_F(UnsentLogStoreTest, SingleElementLogList) { … }
TEST_F(UnsentLogStoreTest, LongButTinyLogList) { … }
TEST_F(UnsentLogStoreTest, LongButSmallLogList) { … }
TEST_F(UnsentLogStoreTest, ShortButLargeLogList) { … }
TEST_F(UnsentLogStoreTest, LongAndLargeLogList) { … }
TEST_F(UnsentLogStoreTest, TrimStagedLog) { … }
TEST_F(UnsentLogStoreTest,
TrimAndPersistUnsentLogs_DoNotOverwriteInMemoryStore) { … }
TEST_F(UnsentLogStoreTest, TrimAndPersistUnsentLogs_MaintainsLogOrder) { … }
TEST_F(UnsentLogStoreTest, TrimAndPersistUnsentLogs_OverwritesPrefs) { … }
TEST_F(UnsentLogStoreTest, Staging) { … }
TEST_F(UnsentLogStoreTest, DiscardOrder) { … }
TEST_F(UnsentLogStoreTest, Hashes) { … }
TEST_F(UnsentLogStoreTest, Signatures) { … }
TEST_F(UnsentLogStoreTest, StoreLogWithUserId) { … }
TEST_F(UnsentLogStoreTest, StoreLogWithLargeUserId) { … }
TEST_F(UnsentLogStoreTest, StoreLogWithOnlyAppKMLogSource) { … }
TEST_F(UnsentLogStoreTest, UnsentLogMetadataMetrics) { … }
}