chromium/chrome/browser/web_applications/isolated_web_apps/isolated_web_app_apply_update_command_unittest.cc

// Copyright 2023 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/isolated_web_apps/isolated_web_app_apply_update_command.h"

#include <memory>
#include <string_view>

#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/overloaded.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_app_provider.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_install_finalizer.h"
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_registry_update.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 "third_party/abseil-cpp/absl/types/variant.h"
#include "ui/gfx/geometry/size.h"
#include "url/url_constants.h"

namespace web_app {
namespace {

HasValue;
ElementsAre;
Eq;
HasSubstr;
IsFalse;
IsNull;
IsTrue;
Return;

constexpr std::string_view kIconPath =;

std::vector<base::FilePath> GetDirContents(const base::FilePath& directory) {}

blink::mojom::ManifestPtr CreateDefaultManifest(const GURL& application_url,
                                                const base::Version version) {}

class IsolatedWebAppApplyUpdateCommandTest : public WebAppTest {};

TEST_F(IsolatedWebAppApplyUpdateCommandTest, Succeeds) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest,
       FailsWhenShuttingDownBeforeCommandStarts) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest, FailsIfIwaIsNotInstalled) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest, FailsIfInstalledAppIsNotIsolated) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest,
       FailsIfInstalledAppHasNoPendingUpdate) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest,
       FailsIfInstalledAppIsOnHigherVersion) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest, FailsIfAppNotTrusted) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest, FailsIfUrlLoadingFails) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest, FailsIfInstallabilityCheckFails) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest, FailsIfManifestIsInvalid) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest, FailsIfIconDownloadFails) {}

TEST_F(IsolatedWebAppApplyUpdateCommandTest, FailsIfInstallFinalizerFails) {}

}  // namespace
}  // namespace web_app