#include "services/network/cors/preflight_result.h"
#include "base/check_deref.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "base/values.h"
#include "net/http/http_request_headers.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace network::cors {
namespace {
PreflightResultTest;
constexpr std::optional<mojom::CorsError> kNoError;
struct TestCase { … };
const TestCase kMethodCases[] = …;
const TestCase kHeaderCases[] = …;
TEST_F(PreflightResultTest, MaxAge) { … }
TEST_F(PreflightResultTest, EnsureMethods) { … }
TEST_F(PreflightResultTest, EnsureHeaders) { … }
TEST_F(PreflightResultTest, EnsureRequest) { … }
struct ParseHeaderListTestCase { … };
const ParseHeaderListTestCase kParseHeadersCases[] = …;
TEST_F(PreflightResultTest, ParseAllowControlAllowHeaders) { … }
struct ParseMethodListTestCase { … };
const ParseMethodListTestCase kParseMethodsCases[] = …;
TEST_F(PreflightResultTest, ParseAllowControlAllowMethods) { … }
net::HttpRequestHeaders CreateHeaders(
const std::vector<std::pair<std::string, std::string>>& data) { … }
TEST_F(PreflightResultTest,
ParseAuthorizationWithoutNonWildcardRequestHeadersSupport) { … }
TEST_F(PreflightResultTest,
ParseAuthorizationWithNonWildcardRequestHeadersSupport) { … }
TEST_F(
PreflightResultTest,
ParseAuthorizationWithNonWildcardRequestHeadersSupportAndAuthorizationOnPreflightResponse) { … }
TEST_F(PreflightResultTest, AuthorizationIsCoveredByAuthorization) { … }
TEST_F(PreflightResultTest, AuthorizationIsCoveredByWildCard) { … }
TEST_F(PreflightResultTest, NoAuthorization) { … }
struct TestCaseForNetLogParams { … };
TEST_F(PreflightResultTest, NetLogParams) { … }
}
}