// 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. #include "components/breadcrumbs/core/breadcrumbs_status.h" #include "base/test/task_environment.h" #include "base/time/time.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h" namespace breadcrumbs { class BreadcrumbsStatusTest : public testing::Test { … }; // Tests that the ScopedEnableBreadcrumbsForTesting object enables breadcrumbs // while it is in scope, and returns it to its default state when deleted. TEST_F(BreadcrumbsStatusTest, ScopedEnableForTesting) { … } // Tests that if breadcrumbs is enabled in user prefs and the prefs' timestamp // is current, breadcrumbs will be enabled without changing the prefs. TEST_F(BreadcrumbsStatusTest, EnabledFromPrefs) { … } // Tests that if breadcrumbs is disabled in user prefs and the prefs' timestamp // is current, breadcrumbs will be disabled without changing the prefs. TEST_F(BreadcrumbsStatusTest, DisabledFromPrefs) { … } // Tests that if breadcrumbs is enabled in user prefs but the prefs' timestamp // has expired, the prefs will be overwritten and the timestamp updated. TEST_F(BreadcrumbsStatusTest, OverwriteExpiredPrefs) { … } // Tests that if breadcrumbs is enabled in user prefs but the prefs' timestamp // is in the future, the prefs will be overwritten and the timestamp updated. TEST_F(BreadcrumbsStatusTest, OverwriteInvalidPrefs) { … } // Tests that if breadcrumbs' user prefs have not been set, the prefs will be // written and the timestamp set to the current time. TEST_F(BreadcrumbsStatusTest, OverwriteMissingPrefs) { … } } // namespace breadcrumbs