#include "chrome/browser/web_applications/commands/web_app_uninstall_command.h"
#include <memory>
#include <optional>
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/test/bind.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "build/buildflag.h"
#include "chrome/browser/web_applications/jobs/uninstall/remove_install_source_job.h"
#include "chrome/browser/web_applications/jobs/uninstall/remove_install_url_job.h"
#include "chrome/browser/web_applications/jobs/uninstall/remove_web_app_job.h"
#include "chrome/browser/web_applications/proto/web_app_install_state.pb.h"
#include "chrome/browser/web_applications/test/fake_web_app_provider.h"
#include "chrome/browser/web_applications/test/mock_file_utils_wrapper.h"
#include "chrome/browser/web_applications/test/test_file_utils.h"
#include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/browser/web_applications/test/web_app_test_observers.h"
#include "chrome/browser/web_applications/test/web_app_test_utils.h"
#include "chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.h"
#include "chrome/browser/web_applications/web_app.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_constants.h"
#include "chrome/browser/web_applications/web_app_icon_manager.h"
#include "chrome/browser/web_applications/web_app_registry_update.h"
#include "chrome/browser/web_applications/web_app_sync_bridge.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "components/prefs/testing_pref_service.h"
#include "components/webapps/browser/installable/installable_metrics.h"
#include "components/webapps/browser/uninstall_result_code.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/origin.h"
namespace web_app {
namespace {
class WebAppUninstallCommandTest : public WebAppTest { … };
TEST_F(WebAppUninstallCommandTest, SimpleUninstallInternal) { … }
TEST_F(WebAppUninstallCommandTest, SimpleUninstallExternal) { … }
TEST_F(WebAppUninstallCommandTest, FailedDataDeletionOrOsHookRemoval) { … }
TEST_F(WebAppUninstallCommandTest, TryToUninstallNonExistentApp) { … }
TEST_F(WebAppUninstallCommandTest, CommandManagerShutdownThrowsError) { … }
TEST_F(WebAppUninstallCommandTest, UserUninstalledPrefsFilled) { … }
TEST_F(WebAppUninstallCommandTest, RemoveSourceAndTriggerOSUninstallation) { … }
TEST_F(WebAppUninstallCommandTest, Shutdown) { … }
struct UninstallSources { … };
class WebAppUninstallCommandSourceTest
: public WebAppUninstallCommandTest,
public testing::WithParamInterface<UninstallSources> { … };
TEST_P(WebAppUninstallCommandSourceTest, RunTestForUninstallSource) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}