#include "chrome/browser/first_run/first_run.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_path_override.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/first_run/first_run_internal.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/installer/util/initial_preferences.h"
#include "components/startup_metric_utils/browser/startup_metric_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace first_run {
namespace {
base::FilePath GetTestDataPath(const std::string& test_name) { … }
base::FilePath GetSentinelFilePath() { … }
}
class FirstRunTest : public testing::Test { … };
TEST_F(FirstRunTest, SetupInitialPrefsFromInstallPrefs_NoVariationsSeed) { … }
TEST_F(FirstRunTest,
SetupInitialPrefsFromInstallPrefs_VariationsSeedSignature) { … }
TEST_F(FirstRunTest, DetermineFirstRunState_FirstRun) { … }
TEST_F(FirstRunTest, DetermineFirstRunState_ForceSwitch) { … }
TEST_F(FirstRunTest, DetermineFirstRunState_NotFirstRun) { … }
TEST_F(FirstRunTest, DetermineFirstRunState_SuppressSwitch) { … }
TEST_F(FirstRunTest, GetFirstRunSentinelCreationTime_Created) { … }
TEST_F(FirstRunTest, GetFirstRunSentinelCreationTime_NotCreated) { … }
TEST_F(FirstRunTest, CreateSentinelIfNeeded) { … }
TEST_F(FirstRunTest, CreateSentinelIfNeeded_DoneEvenIfForced) { … }
TEST_F(FirstRunTest, CreateSentinelIfNeeded_SkippedIfSuppressed) { … }
#if BUILDFLAG(IS_POSIX)
TEST_F(FirstRunTest, CreateSentinelIfNeeded_FileSystemError) { … }
#endif
#if BUILDFLAG(IS_MAC)
#define MAYBE_InitialPrefsUsedIfReadable …
#else
#define MAYBE_InitialPrefsUsedIfReadable …
#endif
TEST_F(FirstRunTest, MAYBE_InitialPrefsUsedIfReadable) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_LegacyInitialPrefsUsedIfNewFileIsNotPresent …
#else
#define MAYBE_LegacyInitialPrefsUsedIfNewFileIsNotPresent …
#endif
TEST_F(FirstRunTest, MAYBE_LegacyInitialPrefsUsedIfNewFileIsNotPresent) { … }
}