chromium/services/network/public/cpp/cross_origin_resource_policy_unittest.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <string>
#include <vector>

#include "base/memory/ref_counted.h"
#include "base/test/scoped_feature_list.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
#include "services/network/public/cpp/cross_origin_resource_policy.h"
#include "services/network/public/mojom/blocked_by_response_reason.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace network {

namespace {
class TestCoepReporter final : public mojom::CrossOriginEmbedderPolicyReporter {};

}  // namespace

CrossOriginResourcePolicy::ParsedHeader ParseHeader(
    const std::string& test_headers) {}

// This test is somewhat redundant with
// wpt/fetch/cross-origin-resource-policy/syntax.any.js
// The delta in coverage is mostly around testing case insensitivity of the
// header name.
TEST(CrossOriginResourcePolicyTest, ParseHeader) {}

TEST(CrossOriginResourcePolicyTest, CrossSiteHeaderWithCOEP) {}

bool ShouldAllowSameSite(const std::string& initiator,
                         const std::string& target) {}

TEST(CrossOriginResourcePolicyTest, ShouldAllowSameSite) {}

void CheckCORP(mojom::RequestMode request_mode,
               const url::Origin& origin,
               mojom::URLResponseHeadPtr response_info,
               const CrossOriginEmbedderPolicy& coep,
               const DocumentIsolationPolicy& dip,
               std::optional<mojom::BlockedByResponseReason> expected_result,
               bool expect_coep_report,
               bool expect_coep_report_only) {}

void RunCORPTestWithCOEPAndDIP(
    const CrossOriginEmbedderPolicy& coep,
    const DocumentIsolationPolicy& dip,
    std::optional<mojom::BlockedByResponseReason> expected_result,
    bool include_credentials,
    bool expect_coep_report,
    bool expect_coep_report_only) {}

TEST(CrossOriginResourcePolicyTest, WithCOEP) {}

TEST(CrossOriginResourcePolicyTest, WithCOEPNoCredentials) {}

TEST(CrossOriginResourcePolicyTest, WithDIP) {}

TEST(CrossOriginResourcePolicyTest, WithDIPNoCredentials) {}

TEST(CrossOriginResourcePolicyTest, WithCOEPAndDIP) {}

TEST(CrossOriginResourcePolicyTest, WithCOEPAndDIPNoCredentials) {}

TEST(CrossOriginResourcePolicyTest, NavigationWithCOEP) {}

}  // namespace network