#include "chrome/browser/web_applications/web_app.h"
#include <memory>
#include <string>
#include <string_view>
#include "base/base64.h"
#include "base/check.h"
#include "base/command_line.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/path_service.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_integrity_block_data.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_storage_location.h"
#include "chrome/browser/web_applications/test/fake_web_app_provider.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_constants.h"
#include "chrome/browser/web_applications/web_app_helpers.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "chrome/common/chrome_paths.h"
#include "components/web_package/signed_web_bundles/ecdsa_p256_public_key.h"
#include "components/web_package/signed_web_bundles/ecdsa_p256_sha256_signature.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_signature_stack_entry.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/permissions_policy/origin_with_possible_wildcards.h"
#include "third_party/blink/public/common/permissions_policy/permissions_policy_declaration.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace web_app {
namespace {
constexpr std::string_view kGenerateExpectationsMessage = …;
base::Value WebAppToPlatformAgnosticDebugValue(
std::unique_ptr<WebApp> web_app) { … }
base::FilePath GetTestDataDir() { … }
base::FilePath GetPathRelativeToTestDataDir(
const base::FilePath absolute_path) { … }
base::FilePath GetPathToTestFile(std::string_view filename) { … }
std::string GetContentsOrDie(const base::FilePath& filepath) { … }
void SetContentsOrDie(const base::FilePath& filepath,
std::string_view contents) { … }
std::string SerializeValueToJsonOrDie(const base::Value& value) { … }
base::Value DeserializeValueFromJsonOrDie(std::string_view json) { … }
bool IsRebaseline() { … }
void SaveExpectationsContentsOrDie(const base::FilePath path,
std::string_view contents) { … }
static constexpr char kEcdsaP256PublicKeyBase64[] = …;
static constexpr char kEcdsaP256SHA256SignatureHex[] = …;
IsolatedWebAppIntegrityBlockData CreateIntegrityBlockData() { … }
}
TEST(WebAppTest, HasAnySources) { … }
TEST(WebAppTest, HasOnlySource) { … }
TEST(WebAppTest, WasInstalledByUser) { … }
TEST(WebAppTest, CanUserUninstallWebApp) { … }
TEST(WebAppTest, EmptyAppAsDebugValue) { … }
TEST(WebAppTest, SampleAppAsDebugValue) { … }
TEST(WebAppTest, RandomAppAsDebugValue_NoCrash) { … }
TEST(WebAppTest, IsolationDataStartsEmpty) { … }
TEST(WebAppTest, IsolationDataDebugValue) { … }
TEST(WebAppTest, IsolationDataPendingUpdateInfoDebugValue) { … }
TEST(WebAppTest, PermissionsPolicyDebugValue) { … }
class WebAppScopeTest : public WebAppTest { … };
TEST_F(WebAppScopeTest, TestScopeIgnored) { … }
}