chromium/components/site_engagement/content/site_engagement_score_unittest.cc

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

#include "components/site_engagement/content/site_engagement_score.h"

#include <optional>
#include <utility>

#include "base/test/simple_test_clock.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/site_engagement/core/mojom/site_engagement_details.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace site_engagement {

namespace {

const int kLessAccumulationsThanNeededToMaxDailyEngagement =;
const int kMoreAccumulationsThanNeededToMaxDailyEngagement =;
const int kMoreAccumulationsThanNeededToMaxTotalEngagement =;
const int kLessDaysThanNeededToMaxTotalEngagement =;
const int kMoreDaysThanNeededToMaxTotalEngagement =;
const int kLessPeriodsThanNeededToDecayMaxScore =;
const int kMorePeriodsThanNeededToDecayMaxScore =;
const double kMaxRoundingDeviation =;

base::Time GetReferenceTime() {}

}  // namespace

class SiteEngagementScoreTest : public testing::Test {};

// Accumulate score many times on the same day. Ensure each time the score goes
// up, but not more than the maximum per day.
TEST_F(SiteEngagementScoreTest, AccumulateOnSameDay) {}

// Accumulate on the first day to max that day's engagement, then accumulate on
// a different day.
TEST_F(SiteEngagementScoreTest, AccumulateOnTwoDays) {}

// Accumulate score on many consecutive days and ensure the score doesn't exceed
// the maximum allowed.
TEST_F(SiteEngagementScoreTest, AccumulateALotOnManyDays) {}

// Accumulate a little on many consecutive days and ensure the score doesn't
// exceed the maximum allowed.
TEST_F(SiteEngagementScoreTest, AccumulateALittleOnManyDays) {}

// Accumulate a bit, then check the score decays properly for a range of times.
TEST_F(SiteEngagementScoreTest, ScoresDecayOverTime) {}

// Test that any expected decays are applied before adding points.
TEST_F(SiteEngagementScoreTest, DecaysAppliedBeforeAdd) {}

// Test that going back in time is handled properly.
TEST_F(SiteEngagementScoreTest, GoBackInTime) {}

// Test that scores are read / written correctly from / to empty score
// dictionaries.
TEST_F(SiteEngagementScoreTest, EmptyDictionary) {}

// Test that scores are read / written correctly from / to partially empty
// score dictionaries.
TEST_F(SiteEngagementScoreTest, PartiallyEmptyDictionary) {}

// Test that scores are read / written correctly from / to populated score
// dictionaries.
TEST_F(SiteEngagementScoreTest, PopulatedDictionary) {}

// Ensure bonus engagement is awarded for the first engagement of a day.
TEST_F(SiteEngagementScoreTest, FirstDailyEngagementBonus) {}

// Test that resetting a score has the correct properties.
TEST_F(SiteEngagementScoreTest, Reset) {}

// Test proportional decay.
TEST_F(SiteEngagementScoreTest, ProportionalDecay) {}

// Verify that GetDetails fills out all fields correctly.
TEST_F(SiteEngagementScoreTest, GetDetails) {}

}  // namespace site_engagement