#include "chrome/browser/web_applications/isolated_web_apps/test/isolated_web_app_fake_response_reader_factory.h"
#include <memory>
#include "base/types/expected.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/web_applications/isolated_web_apps/error/unusable_swbn_file_error.h"
#include "chrome/browser/web_applications/isolated_web_apps/isolated_web_app_validator.h"
#include "chrome/browser/web_applications/isolated_web_apps/signed_web_bundle_reader.h"
#include "chrome/browser/web_applications/isolated_web_apps/test/test_signed_web_bundle_builder.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_id.h"
#include "components/web_package/signed_web_bundles/signed_web_bundle_signature_verifier.h"
#include "components/web_package/test_support/signed_web_bundles/signature_verifier_test_utils.h"
namespace web_app {
namespace {
web_package::SignedWebBundleIntegrityBlock CreateDummyIntegrityBlock() { … }
}
web_package::SignedWebBundleIntegrityBlock
MockIsolatedWebAppResponseReader::GetIntegrityBlock() { … }
void MockIsolatedWebAppResponseReader::ReadResponse(
const network::ResourceRequest& resource_request,
ReadResponseCallback callback) { … }
void MockIsolatedWebAppResponseReader::Close(base::OnceClosure callback) { … }
FakeResponseReaderFactory::FakeResponseReaderFactory(
Profile& profile,
base::expected<void, UnusableSwbnFileError> bundle_status)
: … { … }
FakeResponseReaderFactory::~FakeResponseReaderFactory() = default;
void FakeResponseReaderFactory::CreateResponseReader(
const base::FilePath& web_bundle_path,
const web_package::SignedWebBundleId& web_bundle_id,
IsolatedWebAppResponseReaderFactory::Flags flags,
Callback callback) { … }
}