#include "chrome/browser/user_education/browser_feature_promo_storage_service.h"
#include <memory>
#include "base/feature_list.h"
#include "base/json/values_util.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "base/time/clock.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "chrome/test/base/testing_profile.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/user_education/common/feature_promo_data.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
BASE_FEATURE(…);
BASE_FEATURE(…);
constexpr char kAppName1[] = …;
constexpr char kAppName2[] = …;
constexpr base::Time kSessionTime = …;
constexpr base::Time kLastActiveTime = …;
constexpr base::Time kNewSessionTime = …;
constexpr base::Time kNewActiveTime = …;
constexpr base::Time kLastShownTime1 = …;
constexpr base::Time kLastShownTime2 = …;
}
class BrowserFeaturePromoStorageServiceTest : public testing::Test { … };
TEST_F(BrowserFeaturePromoStorageServiceTest, NoDataByDefault) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SavesAndReadsData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SaveAgain) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, ResetClearsData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SavesAndReadsMultipleFeatures) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, NoSessionDataByDefault) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SavesAndReadsSessionData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SaveSessionAgain) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, ResetSessionClearsData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, NoNewBadgeDataByDefault) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SavesAndReadsNewBadgeData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SavesAndClearNewBadgeData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SaveNewBadgeDataAgain) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SaveMultipleNewBadgeData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, SaveAndRestoreRecentSessionData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest,
SaveRecentSessionDataMultipleTimes) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest,
SaveAndRestoreRecentSessionData_NoEnabledTime) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest,
SaveAndRestoreRecentSessionData_ElidesOutOfOrderEntries) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, ResetRecentSessionData) { … }
TEST_F(BrowserFeaturePromoStorageServiceTest, LegacyDataTest) { … }