#include "chrome/browser/web_applications/commands/uninstall_all_user_installed_web_apps_command.h"
#include <memory>
#include "base/memory/scoped_refptr.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "chrome/browser/ui/web_applications/test/isolated_web_app_test_utils.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h"
#include "chrome/browser/web_applications/policy/web_app_policy_constants.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/web_app.h"
#include "chrome/browser/web_applications/web_app_command_manager.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_utils.h"
#include "chrome/common/pref_names.h"
#include "components/nacl/common/buildflags.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_id.h"
#include "content/public/browser/browsing_data_remover.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(ENABLE_NACL)
#include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h"
#include "components/nacl/browser/nacl_browser.h"
#endif
namespace web_app {
namespace {
void WaitForPendingDataClearingTasks(Profile* profile) { … }
#if BUILDFLAG(ENABLE_NACL)
class ScopedNaClBrowserDelegate {
public:
explicit ScopedNaClBrowserDelegate(ProfileManager* profile_manager) {
nacl::NaClBrowser::SetDelegate(
std::make_unique<NaClBrowserDelegateImpl>(profile_manager));
}
~ScopedNaClBrowserDelegate() { nacl::NaClBrowser::ClearAndDeleteDelegate(); }
};
#endif
}
class UninstallAllUserInstalledWebAppsCommandTest : public WebAppTest { … };
TEST_F(UninstallAllUserInstalledWebAppsCommandTest, NoUserInstalledWebApps) { … }
TEST_F(UninstallAllUserInstalledWebAppsCommandTest, RemovesUserInstallSources) { … }
TEST_F(UninstallAllUserInstalledWebAppsCommandTest,
UninstallsUserInstalledWebApps) { … }
class UninstallAllUserInstalledWebAppsCommandWithIconManagerTest
: public UninstallAllUserInstalledWebAppsCommandTest { … };
TEST_F(UninstallAllUserInstalledWebAppsCommandWithIconManagerTest,
ReturnUninstallErrors) { … }
}