chromium/content/browser/renderer_host/private_network_access_util_unittest.cc

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

#include "content/browser/renderer_host/private_network_access_util.h"

#include <array>
#include <ostream>
#include <string_view>
#include <tuple>
#include <vector>

#include "base/command_line.h"
#include "base/test/scoped_feature_list.h"
#include "content/common/features.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "services/network/public/mojom/client_security_state.mojom.h"
#include "services/network/public/mojom/ip_address_space.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace content {
namespace {

AddressSpace;
RequestContext;
Policy;

ElementsAreArray;

// Self-descriptive constants for `is_web_secure_context`.
constexpr bool kNonSecure =;
constexpr bool kSecure =;

// Input arguments to `DerivePrivateNetworkRequestPolicy()`.
struct DerivePolicyInput {};

std::string_view RequestContextToStringPiece(RequestContext request_context) {}

// For ease of debugging.
std::ostream& operator<<(std::ostream& out, const DerivePolicyInput& input) {}

Policy DerivePolicy(DerivePolicyInput input) {}

// Maps inputs to their default output (all feature flags left untouched).
std::map<DerivePolicyInput, Policy> DefaultPolicyMap() {}

std::map<DerivePolicyInput, Policy> AllAllowMap() {}

// Runs `DerivePolicy()` on each key and compares the result to the map value.
void TestPolicyMap(const std::map<DerivePolicyInput, Policy>& expected) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicy) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyBlockFromInsecurePrivate) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyBlockFromInsecureUnknown) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyNoPreflights) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyRespectPreflightResults) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyWorkers) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyWorkersWithPreflights) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyDisableWebSecurity) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyIframesWarningOnly) {}

TEST(PrivateNetworkAccessUtilTest,
     DerivePolicyIframesWarningOnlyWithPreflights) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyIframes) {}

TEST(PrivateNetworkAccessUtilTest, DerivePolicyIframesWithPreflights) {}

}  // namespace
}  // namespace content