chromium/chrome/browser/user_education/recent_session_tracker_unittest.cc

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

#include "chrome/browser/user_education/recent_session_tracker.h"

#include <memory>
#include <optional>
#include <vector>

#include "base/callback_list.h"
#include "base/memory/raw_ref.h"
#include "base/test/bind.h"
#include "base/test/simple_test_clock.h"
#include "base/time/time.h"
#include "chrome/browser/user_education/browser_feature_promo_storage_service.h"
#include "components/user_education/common/feature_promo_data.h"
#include "components/user_education/common/feature_promo_session_manager.h"
#include "components/user_education/common/feature_promo_storage_service.h"
#include "components/user_education/test/test_feature_promo_storage_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

// At some point these may need to be moved to a common header file.

// Short-circuits all of the functionality of the session manager except for
// updating session data and sending notifications.
class FakeSessionManager
    : protected user_education::FeaturePromoSessionManager {};

// Implementation of `RecentSessionDataStorageService` that extends
// `TestFeaturePromoStorageService` with in-memory data storage.
class TestBrowserStorageService
    : public user_education::test::TestFeaturePromoStorageService,
      public RecentSessionDataStorageService {};

base::Time Days(double d) {}

}  // namespace

class RecentSessionTrackerTest : public testing::Test {};

TEST_F(RecentSessionTrackerTest, NoNewSession) {}

TEST_F(RecentSessionTrackerTest, NewSessionBeforeInit) {}

TEST_F(RecentSessionTrackerTest, NewSessionAfterInit) {}

TEST_F(RecentSessionTrackerTest, OldSessionsRollOff) {}

TEST_F(RecentSessionTrackerTest, TooManySessionsRollOff) {}

TEST_F(RecentSessionTrackerTest, ClockSetBackElidesValues) {}

TEST_F(RecentSessionTrackerTest, EnabledForTheFirstTime) {}