chromium/components/user_education/test/feature_promo_session_test_util.h

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

#ifndef COMPONENTS_USER_EDUCATION_TEST_FEATURE_PROMO_SESSION_TEST_UTIL_H_
#define COMPONENTS_USER_EDUCATION_TEST_FEATURE_PROMO_SESSION_TEST_UTIL_H_

#include <memory>
#include <optional>

#include "base/memory/raw_ref.h"
#include "base/test/simple_test_clock.h"
#include "base/time/time.h"

namespace user_education {
struct FeaturePromoPolicyData;
struct FeaturePromoSessionData;
class FeaturePromoSessionManager;
class FeaturePromoStorageService;
}  // namespace user_education

namespace user_education::test {

class TestIdleObserver;

// Class which seizes control of a `FeaturePromoSessionManager` and its
// associated session data, and gives a test fine control over the clock and the
// active state of the current session, simulating active and inactive periods.
//
// This object should not outlive the session manager itself. Also, once this
// object has been attached to a session manager, it will no longer receive
// normal session updated, even after this object is destroyed, to avoid
// spurious events occurring at the end of a test or during teardown.
//
// USAGE NOTE: for browser-based tests, prefer using
// `InteractiveFeaturePromoTest[T]` instead of directly using this class.
class FeaturePromoSessionTestUtil {};

}  // namespace user_education::test

#endif  // COMPONENTS_USER_EDUCATION_TEST_FEATURE_PROMO_SESSION_TEST_UTIL_H_