#include "components/component_updater/component_installer.h"
#include <iterator>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/barrier_closure.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/sequence_checker.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/bind.h"
#include "base/test/scoped_path_override.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "base/version.h"
#include "build/branding_buildflags.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/component_updater/component_updater_service.h"
#include "components/component_updater/component_updater_service_internal.h"
#include "components/crx_file/crx_verifier.h"
#include "components/prefs/testing_pref_service.h"
#include "components/update_client/crx_update_item.h"
#include "components/update_client/patcher.h"
#include "components/update_client/test_configurator.h"
#include "components/update_client/test_utils.h"
#include "components/update_client/unpacker.h"
#include "components/update_client/unzipper.h"
#include "components/update_client/update_client.h"
#include "components/update_client/update_client_errors.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
Configurator;
CrxUpdateItem;
TestConfigurator;
UpdateClient;
_;
Invoke;
namespace component_updater {
namespace {
constexpr uint8_t kSha256Hash[] = …;
constexpr base::FilePath::CharType relative_install_dir[] = …);
class MockUpdateClient : public UpdateClient { … };
class MockInstallerPolicy : public ComponentInstallerPolicy { … };
class MockUpdateScheduler : public UpdateScheduler { … };
class ComponentInstallerTest : public testing::Test { … };
ComponentInstallerTest::ComponentInstallerTest() { … }
ComponentInstallerTest::~ComponentInstallerTest() { … }
void ComponentInstallerTest::RunThreads() { … }
void ComponentInstallerTest::Unpack(const base::FilePath& crx_path) { … }
void ComponentInstallerTest::UnpackComplete(
const update_client::Unpacker::Result& result) { … }
void ComponentInstallerTest::Schedule(
const base::TimeDelta& initial_delay,
const base::TimeDelta& delay,
const UpdateScheduler::UserTask& user_task,
const UpdateScheduler::OnStopTaskCallback& on_stop) { … }
}
std::optional<base::FilePath> CreateComponentDirectory(
const base::FilePath& base_dir,
const std::string& name,
const std::string& version,
const std::string& min_env_version) { … }
TEST_F(ComponentInstallerTest, RegisterComponent) { … }
TEST_F(ComponentInstallerTest, InstallerRegister_CheckSequence) { … }
TEST_F(ComponentInstallerTest, UnpackPathInstallSuccess) { … }
TEST_F(ComponentInstallerTest, UnpackPathInstallError) { … }
TEST_F(ComponentInstallerTest, SelectComponentVersion) { … }
TEST_F(ComponentInstallerTest, Uninstall) { … }
TEST_F(ComponentInstallerTest, UninstallWithoutRegister) { … }
}