chromium/chrome/browser/web_applications/test/fake_web_app_provider.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/web_applications/test/fake_web_app_provider.h"

#include <memory>
#include <ostream>
#include <utility>

#include "base/check.h"
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
#include "base/one_shot_event.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/externally_managed_app_manager.h"
#include "chrome/browser/web_applications/file_utils_wrapper.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_installation_manager.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_update_manager.h"
#include "chrome/browser/web_applications/isolated_web_apps/iwa_identity_validator.h"
#include "chrome/browser/web_applications/manifest_update_manager.h"
#include "chrome/browser/web_applications/os_integration/os_integration_manager.h"
#include "chrome/browser/web_applications/policy/web_app_policy_manager.h"
#include "chrome/browser/web_applications/preinstalled_web_app_manager.h"
#include "chrome/browser/web_applications/test/fake_externally_managed_app_manager.h"
#include "chrome/browser/web_applications/test/fake_os_integration_manager.h"
#include "chrome/browser/web_applications/test/fake_web_app_database_factory.h"
#include "chrome/browser/web_applications/test/fake_web_app_ui_manager.h"
#include "chrome/browser/web_applications/test/fake_web_contents_manager.h"
#include "chrome/browser/web_applications/test/test_file_utils.h"
#include "chrome/browser/web_applications/web_app_command_manager.h"
#include "chrome/browser/web_applications/web_app_command_scheduler.h"
#include "chrome/browser/web_applications/web_app_database_factory.h"
#include "chrome/browser/web_applications/web_app_icon_manager.h"
#include "chrome/browser/web_applications/web_app_install_finalizer.h"
#include "chrome/browser/web_applications/web_app_install_manager.h"
#include "chrome/browser/web_applications/web_app_origin_association_manager.h"
#include "chrome/browser/web_applications/web_app_provider_factory.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/browser/web_applications/web_app_sync_bridge.h"
#include "chrome/browser/web_applications/web_app_translation_manager.h"
#include "chrome/browser/web_applications/web_app_ui_manager.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "chrome/browser/web_applications/web_contents/web_contents_manager.h"
#include "chrome/common/chrome_switches.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/sync/test/mock_data_type_local_change_processor.h"
#include "testing/gmock/include/gmock/gmock.h"

#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/web_applications/web_app_run_on_os_login_manager.h"
#endif

namespace web_app {

// static
std::unique_ptr<KeyedService> FakeWebAppProvider::BuildDefault(
    content::BrowserContext* context) {}

// static
FakeWebAppProvider* FakeWebAppProvider::Get(Profile* profile) {}

FakeWebAppProvider::FakeWebAppProvider(Profile* profile)
    :{}

FakeWebAppProvider::~FakeWebAppProvider() = default;

void FakeWebAppProvider::SetStartSystemOnStart(bool run_system_on_start) {}

void FakeWebAppProvider::SetSynchronizePreinstalledAppsOnStartup(
    bool synchronize_on_startup) {}

void FakeWebAppProvider::UseRealOsIntegrationManager() {}

void FakeWebAppProvider::SetEnableAutomaticIwaUpdates(
    AutomaticIwaUpdateStrategy automatic_iwa_update_strategy) {}

void FakeWebAppProvider::SetRegistrar(
    std::unique_ptr<WebAppRegistrarMutable> registrar) {}

void FakeWebAppProvider::SetDatabaseFactory(
    std::unique_ptr<AbstractWebAppDatabaseFactory> database_factory) {}

void FakeWebAppProvider::SetSyncBridge(
    std::unique_ptr<WebAppSyncBridge> sync_bridge) {}

void FakeWebAppProvider::SetFileUtils(
    scoped_refptr<FileUtilsWrapper> file_utils) {}

void FakeWebAppProvider::SetIconManager(
    std::unique_ptr<WebAppIconManager> icon_manager) {}

void FakeWebAppProvider::SetTranslationManager(
    std::unique_ptr<WebAppTranslationManager> translation_manager) {}

void FakeWebAppProvider::SetOsIntegrationManager(
    std::unique_ptr<OsIntegrationManager> os_integration_manager) {}

void FakeWebAppProvider::SetInstallManager(
    std::unique_ptr<WebAppInstallManager> install_manager) {}

void FakeWebAppProvider::SetInstallFinalizer(
    std::unique_ptr<WebAppInstallFinalizer> install_finalizer) {}

void FakeWebAppProvider::SetExternallyManagedAppManager(
    std::unique_ptr<ExternallyManagedAppManager>
        externally_managed_app_manager) {}

void FakeWebAppProvider::SetWebAppUiManager(
    std::unique_ptr<WebAppUiManager> ui_manager) {}

void FakeWebAppProvider::SetIsolatedWebAppInstallationManager(
    std::unique_ptr<IsolatedWebAppInstallationManager>
        isolated_web_app_installation_manager) {}

void FakeWebAppProvider::SetWebAppPolicyManager(
    std::unique_ptr<WebAppPolicyManager> web_app_policy_manager) {}

#if BUILDFLAG(IS_CHROMEOS)
void FakeWebAppProvider::SetIsolatedWebAppUpdateManager(
    std::unique_ptr<IsolatedWebAppUpdateManager> iwa_update_manager) {
  CheckNotStartedAndDisconnect();
  iwa_update_manager_ = std::move(iwa_update_manager);
}

void FakeWebAppProvider::SetWebAppRunOnOsLoginManager(
    std::unique_ptr<WebAppRunOnOsLoginManager>
        web_app_run_on_os_login_manager) {
  CheckNotStartedAndDisconnect();
  web_app_run_on_os_login_manager_ = std::move(web_app_run_on_os_login_manager);
}
#endif

void FakeWebAppProvider::SetCommandManager(
    std::unique_ptr<WebAppCommandManager> command_manager) {}

void FakeWebAppProvider::SetScheduler(
    std::unique_ptr<WebAppCommandScheduler> scheduler) {}

void FakeWebAppProvider::SetPreinstalledWebAppManager(
    std::unique_ptr<PreinstalledWebAppManager> preinstalled_web_app_manager) {}

void FakeWebAppProvider::SetOriginAssociationManager(
    std::unique_ptr<WebAppOriginAssociationManager>
        origin_association_manager) {}

void FakeWebAppProvider::SetWebContentsManager(
    std::unique_ptr<WebContentsManager> web_contents_manager) {}

WebAppRegistrarMutable& FakeWebAppProvider::GetRegistrarMutable() const {}

WebAppIconManager& FakeWebAppProvider::GetIconManager() const {}

WebAppCommandManager& FakeWebAppProvider::GetCommandManager() const {}

AbstractWebAppDatabaseFactory& FakeWebAppProvider::GetDatabaseFactory() const {}

WebAppUiManager& FakeWebAppProvider::GetUiManager() const {}

WebAppInstallManager& FakeWebAppProvider::GetInstallManager() const {}

OsIntegrationManager& FakeWebAppProvider::GetOsIntegrationManager() const {}

void FakeWebAppProvider::StartWithSubsystems() {}

void FakeWebAppProvider::CreateFakeSubsystems() {}

void FakeWebAppProvider::ShutDownUiManagerForTesting() {}

void FakeWebAppProvider::Shutdown() {}

FakeWebAppProvider* FakeWebAppProvider::AsFakeWebAppProviderForTesting() {}

void FakeWebAppProvider::CheckNotStartedAndDisconnect(
    std::string optional_message) {}

void FakeWebAppProvider::StartImpl() {}

FakeWebAppProviderCreator::FakeWebAppProviderCreator()
    :{}

FakeWebAppProviderCreator::FakeWebAppProviderCreator(
    CreateWebAppProviderCallback callback)
    :{}

FakeWebAppProviderCreator::~FakeWebAppProviderCreator() = default;

void FakeWebAppProviderCreator::OnWillCreateBrowserContextServices(
    content::BrowserContext* context) {}

std::unique_ptr<KeyedService> FakeWebAppProviderCreator::CreateWebAppProvider(
    content::BrowserContext* context) {}

}  // namespace web_app