#include <optional>
#include <string>
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/process/process_iterator.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/test/bind.h"
#include "base/test/test_timeouts.h"
#include "build/branding_buildflags.h"
#include "chrome/updater/activity.h"
#include "chrome/updater/activity_impl_util_posix.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/external_constants_builder.h"
#include "chrome/updater/linux/systemd_util.h"
#include "chrome/updater/persisted_data.h"
#include "chrome/updater/prefs.h"
#include "chrome/updater/registration_data.h"
#include "chrome/updater/service_proxy_factory.h"
#include "chrome/updater/test/integration_tests_impl.h"
#include "chrome/updater/test/unit_test_util.h"
#include "chrome/updater/update_service.h"
#include "chrome/updater/updater_branding.h"
#include "chrome/updater/updater_scope.h"
#include "chrome/updater/util/linux_util.h"
#include "chrome/updater/util/posix_util.h"
#include "chrome/updater/util/util.h"
#include "components/crx_file/crx_verifier.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace updater::test {
namespace {
base::FilePath GetExecutablePath() { … }
}
std::optional<base::FilePath> GetFakeUpdaterInstallFolderPath(
UpdaterScope scope,
const base::Version& version) { … }
base::FilePath GetSetupExecutablePath() { … }
std::optional<base::FilePath> GetInstalledExecutablePath(UpdaterScope scope) { … }
bool WaitForUpdaterExit() { … }
void Uninstall(UpdaterScope scope) { … }
void ExpectCandidateUninstalled(UpdaterScope scope) { … }
void ExpectInstalled(UpdaterScope scope) { … }
void Clean(UpdaterScope scope) { … }
void ExpectMostlyClean(const std::optional<base::FilePath>& path) { … }
void ExpectClean(UpdaterScope scope) { … }
void EnterTestMode(const GURL& update_url,
const GURL& crash_upload_url,
const GURL& device_management_url,
const GURL& app_logo_url,
const base::TimeDelta& idle_timeout) { … }
void SetActive(UpdaterScope scope, const std::string& app_id) { … }
void ExpectActive(UpdaterScope scope, const std::string& app_id) { … }
void ExpectNotActive(UpdaterScope scope, const std::string& app_id) { … }
base::FilePath GetRealUpdaterLowerVersionPath() { … }
void SetupFakeLegacyUpdater(UpdaterScope scope) { … }
void ExpectLegacyUpdaterMigrated(UpdaterScope scope) { … }
void InstallApp(UpdaterScope scope,
const std::string& app_id,
const base::Version& version) { … }
void UninstallApp(UpdaterScope scope, const std::string& app_id) { … }
base::CommandLine MakeElevated(base::CommandLine command_line) { … }
void SetPlatformPolicies(const base::Value::Dict& values) { … }
void ExpectAppVersion(UpdaterScope scope,
const std::string& app_id,
const base::Version& version) { … }
}