#include "components/metrics/data_use_tracker.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace metrics {
namespace {
const char kTodayStr[] = …;
const char kYesterdayStr[] = …;
const char kExpiredDateStr1[] = …;
const char kExpiredDateStr2[] = …;
class TestDataUsePrefService : public TestingPrefServiceSimple { … };
class FakeDataUseTracker : public DataUseTracker { … };
void SetPrefTestValuesOverRatio(PrefService* local_state) { … }
void SetPrefTestValuesValidRatio(PrefService* local_state) { … }
}
TEST(DataUseTrackerTest, CheckUpdateUsagePref) { … }
TEST(DataUseTrackerTest, CheckRemoveExpiredEntries) { … }
TEST(DataUseTrackerTest, CheckComputeTotalDataUse) { … }
TEST(DataUseTrackerTest, CheckShouldUploadLogOnCellular) { … }
}