#include "chrome/browser/extensions/test_extension_system.h"
#include <memory>
#include <utility>
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/blocklist.h"
#include "chrome/browser/extensions/chrome_app_sorting.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/cws_info_service.h"
#include "chrome/browser/extensions/cws_info_service_factory.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/shared_module_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "components/prefs/pref_service.h"
#include "components/services/unzip/content/unzip_service.h"
#include "components/services/unzip/in_process_unzipper.h"
#include "components/value_store/test_value_store_factory.h"
#include "components/value_store/testing_value_store.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/state_store.h"
#include "extensions/browser/user_script_manager.h"
#include "services/data_decoder/data_decoder_service.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "components/user_manager/fake_user_manager.h"
#include "components/user_manager/scoped_user_manager.h"
#include "components/user_manager/user_manager.h"
#endif
BrowserThread;
namespace extensions {
namespace {
class FakeCWSInfoService : public CWSInfoService { … };
std::optional<bool> FakeCWSInfoService::IsLiveInCWS(
const Extension& extension) const { … }
std::optional<CWSInfoServiceInterface::CWSInfo> FakeCWSInfoService::GetCWSInfo(
const Extension& extension) const { … }
std::unique_ptr<KeyedService> BuildFakeCWSService(
content::BrowserContext* context) { … }
}
TestExtensionSystem::TestExtensionSystem(Profile* profile)
: … { … }
TestExtensionSystem::~TestExtensionSystem() = default;
void TestExtensionSystem::Shutdown() { … }
ExtensionService* TestExtensionSystem::CreateExtensionService(
const base::CommandLine* command_line,
const base::FilePath& install_directory,
bool autoupdate_enabled,
bool extensions_enabled) { … }
ExtensionService* TestExtensionSystem::CreateExtensionService(
const base::CommandLine* command_line,
const base::FilePath& install_directory,
const base::FilePath& unpacked_install_directory,
bool autoupdate_enabled,
bool extensions_enabled) { … }
void TestExtensionSystem::CreateUserScriptManager() { … }
ExtensionService* TestExtensionSystem::extension_service() { … }
ManagementPolicy* TestExtensionSystem::management_policy() { … }
void TestExtensionSystem::SetExtensionService(ExtensionService* service) { … }
ServiceWorkerManager* TestExtensionSystem::service_worker_manager() { … }
UserScriptManager* TestExtensionSystem::user_script_manager() { … }
StateStore* TestExtensionSystem::state_store() { … }
StateStore* TestExtensionSystem::rules_store() { … }
StateStore* TestExtensionSystem::dynamic_user_scripts_store() { … }
scoped_refptr<value_store::ValueStoreFactory>
TestExtensionSystem::store_factory() { … }
QuotaService* TestExtensionSystem::quota_service() { … }
AppSorting* TestExtensionSystem::app_sorting() { … }
const base::OneShotEvent& TestExtensionSystem::ready() const { … }
bool TestExtensionSystem::is_ready() const { … }
ContentVerifier* TestExtensionSystem::content_verifier() { … }
std::unique_ptr<ExtensionSet> TestExtensionSystem::GetDependentExtensions(
const Extension* extension) { … }
void TestExtensionSystem::InstallUpdate(
const std::string& extension_id,
const std::string& public_key,
const base::FilePath& temp_dir,
bool install_immediately,
InstallUpdateCallback install_update_callback) { … }
void TestExtensionSystem::PerformActionBasedOnOmahaAttributes(
const std::string& extension_id,
const base::Value::Dict& attributes) { … }
bool TestExtensionSystem::FinishDelayedInstallationIfReady(
const std::string& extension_id,
bool install_immediately) { … }
value_store::TestingValueStore* TestExtensionSystem::value_store() { … }
std::unique_ptr<KeyedService> TestExtensionSystem::Build(
content::BrowserContext* profile) { … }
void TestExtensionSystem::RecreateAppSorting() { … }
}