#include "chrome/browser/enterprise/idle/action_runner.h"
#include "base/memory/raw_ptr.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "build/build_config.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h"
#include "chrome/browser/enterprise/idle/action.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
#include "components/enterprise/idle/idle_pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browsing_data_remover.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/test/views/chrome_views_test_base.h"
#endif
namespace enterprise_idle {
BrowsingDataRemover;
_;
IsEmpty;
Return;
UnorderedElementsAre;
namespace {
class FakeActionFactory : public ActionFactory { … };
class MockAction : public Action { … };
ACTION_P(RunContinuation, success) { … }
}
#if !BUILDFLAG(IS_ANDROID)
TEST(IdleActionRunnerTest, RunsActionsInSequence) { … }
TEST(IdleActionRunnerTest, PrefOrderDoesNotMatter) { … }
TEST(IdleActionRunnerTest, OtherActionsDontRunOnFailure) { … }
#endif
TEST(IdleActionRunnerTest, DoNothingWithEmptyPref) { … }
#if !BUILDFLAG(IS_ANDROID)
TEST(IdleActionRunnerTest, JustCloseBrowsers) { … }
TEST(IdleActionRunnerTest, JustShowProfilePicker) { … }
#endif
class FakeBrowsingDataRemover : public BrowsingDataRemover { … };
#if !BUILDFLAG(IS_ANDROID)
class IdleActionRunnerClearDataTest : public ChromeViewsTestBase { … };
TEST_F(IdleActionRunnerClearDataTest, ClearBrowsingHistory) { … }
TEST_F(IdleActionRunnerClearDataTest, ClearDownloadHistory) { … }
TEST_F(IdleActionRunnerClearDataTest, ClearCookies) { … }
TEST_F(IdleActionRunnerClearDataTest, ClearCache) { … }
TEST_F(IdleActionRunnerClearDataTest, ClearPasswordSignin) { … }
TEST_F(IdleActionRunnerClearDataTest, ClearAutofill) { … }
TEST_F(IdleActionRunnerClearDataTest, ClearSiteSettings) { … }
TEST_F(IdleActionRunnerClearDataTest, ClearHostedAppData) { … }
TEST_F(IdleActionRunnerClearDataTest, MultipleTypes) { … }
TEST_F(IdleActionRunnerClearDataTest, MultipleTypesAndFailure) { … }
#endif
}