#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_prepare_and_store_update_command.h"
#include <memory>
#include <string_view>
#include "base/containers/flat_set.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/gmock_expected_support.h"
#include "base/test/test_future.h"
#include "base/types/expected.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_source.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_storage_location.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_trust_checker.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_url_info.h"
#include "chrome/browser/web_applications/isolated_web_apps/test/test_signed_web_bundle_builder.h"
#include "chrome/browser/web_applications/test/fake_web_contents_manager.h"
#include "chrome/browser/web_applications/test/web_app_icon_test_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_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_command_scheduler.h"
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_registry_update.h"
#include "chrome/browser/web_applications/web_app_sync_bridge.h"
#include "chrome/common/url_constants.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_id.h"
#include "components/webapps/browser/install_result_code.h"
#include "components/webapps/browser/web_contents/web_app_url_loader.h"
#include "content/public/browser/web_contents.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/size.h"
#include "url/url_constants.h"
namespace web_app {
namespace {
ErrorIs;
ValueIs;
_;
Eq;
Field;
HasSubstr;
IsFalse;
IsNull;
IsTrue;
Return;
constexpr std::string_view kIconPath = …;
blink::mojom::ManifestPtr CreateDefaultManifest(const GURL& application_url,
const base::Version version) { … }
MATCHER_P(IsErrorWithMessage, message_matcher, "") { … }
class IsolatedWebAppUpdatePrepareAndStoreCommandTest : public WebAppTest { … };
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest, Succeeds) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
SucceedsIfVersionIsNotSpecified) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest, FailsWhenShuttingDown) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
FailsIfIwaIsNotInstalled) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
FailsIfInstalledAppIsNotIsolated) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
FailsIfInstalledAppIsOnHigherVersion) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
FailsIfInstalledAppIsOnHigherVersionAndNoExpectedVersionIsSpecified) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
FailsIfInstalledAppHasOtherIwaLocationType) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest, FailsIfAppNotTrusted) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest, FailsIfUrlLoadingFails) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
FailsIfInstallabilityCheckFails) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
FailsIfManifestIsInvalid) { … }
TEST_F(IsolatedWebAppUpdatePrepareAndStoreCommandTest,
FailsIfIconDownloadFails) { … }
}
}