chromium/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest_fetcher_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/update_manifest/update_manifest_fetcher.h"

#include <string_view>

#include "base/memory/scoped_refptr.h"
#include "base/test/gmock_expected_support.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "base/types/expected.h"
#include "chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "services/network/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace web_app {
namespace {

ElementsAre;
Eq;
IsEmpty;
IsFalse;
IsTrue;

constexpr std::string_view kValidManifestUrl =;

constexpr std::string_view kInvalidManifestUrl =;

constexpr std::string_view kManifestWithoutVersionsUrl =;

constexpr std::string_view kInvalidJsonUrl =;

constexpr std::string_view k404Url =;

class UpdateManifestFetcherTest : public ::testing::Test {};

TEST_F(UpdateManifestFetcherTest, FetchesValidManifest) {}

TEST_F(UpdateManifestFetcherTest, SucceedsWhenManifestHasNoVersions) {}

TEST_F(UpdateManifestFetcherTest, FailsWhenManifestIsInvalid) {}

TEST_F(UpdateManifestFetcherTest, FailsWhenJsonIsInvalid) {}

TEST_F(UpdateManifestFetcherTest, FailedDownload) {}

}  // namespace
}  // namespace web_app