#include "services/network/public/cpp/content_security_policy/csp_source.h"
#include "base/test/scoped_feature_list.h"
#include "net/http/http_response_headers.h"
#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/origin.h"
#include "url/url_features.h"
namespace network {
namespace {
static const network::mojom::CSPSource no_self;
network::mojom::CSPSourcePtr CSPSource(const std::string& raw) { … }
enum class NonSpecialUrlBehavior { … };
}
class CSPSourceTest : public testing::TestWithParam<
std::tuple<CSPSourceContext, NonSpecialUrlBehavior>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CSPSourceTest, BasicMatching) { … }
TEST_P(CSPSourceTest, AllowScheme) { … }
TEST_P(CSPSourceTest, AllowHost) { … }
TEST_P(CSPSourceTest, AllowPort) { … }
TEST_P(CSPSourceTest, AllowPath) { … }
TEST_P(CSPSourceTest, RedirectMatching) { … }
TEST_P(CSPSourceTest, Intersect) { … }
TEST_P(CSPSourceTest, DoesNotSubsume) { … }
TEST_P(CSPSourceTest, Subsumes) { … }
TEST_P(CSPSourceTest, HostWildcardSubsumes) { … }
TEST_P(CSPSourceTest, PortWildcardSubsumes) { … }
TEST_P(CSPSourceTest, SchemesOnlySubsumes) { … }
TEST_P(CSPSourceTest, ToString) { … }
TEST_P(CSPSourceTest, UpgradeRequests) { … }
TEST_P(CSPSourceTest, CustomSchemeWithHost) { … }
TEST_P(CSPSourceTest, CustomScheme) { … }
TEST_P(CSPSourceTest, OpaqueURLMatchingAllowSchemeHttps) { … }
TEST_P(CSPSourceTest, OpaqueURLMatchingAllowSchemeNonHttps) { … }
TEST_P(CSPSourceTest, OpaqueURLMatchingAllowHostAndPort) { … }
}