#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/http/http_no_vary_search_data.h"
#include <string>
#include <string_view>
#include "base/containers/flat_map.h"
#include "base/containers/flat_set.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/string_util.h"
#include "base/test/gmock_expected_support.h"
#include "base/types/expected.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace net {
namespace {
IsEmpty;
UnorderedElementsAreArray;
TEST(HttpNoVarySearchCreateTest, CreateFromNoVaryParamsNonEmptyVaryOnKeyOrder) { … }
TEST(HttpNoVarySearchCreateTest,
CreateFromNoVaryParamsNonEmptyNoVaryOnKeyOrder) { … }
TEST(HttpNoVarySearchCreateTest, CreateFromNoVaryParamsEmptyNoVaryOnKeyOrder) { … }
TEST(HttpNoVarySearchCreateTest, CreateFromNoVaryParamsEmptyVaryOnKeyOrder) { … }
TEST(HttpNoVarySearchCreateTest, CreateFromVaryParamsNonEmptyVaryOnKeyOrder) { … }
TEST(HttpNoVarySearchCreateTest, CreateFromVaryParamsNonEmptyNoVaryOnKeyOrder) { … }
TEST(HttpNoVarySearchCreateTest, CreateFromVaryParamsEmptyNoVaryOnKeyOrder) { … }
TEST(HttpNoVarySearchCreateTest, CreateFromVaryParamsEmptyVaryOnKeyOrder) { … }
struct TestData { … };
class HttpNoVarySearchResponseHeadersTest
: public ::testing::Test,
public ::testing::WithParamInterface<TestData> { … };
TEST_P(HttpNoVarySearchResponseHeadersTest, ParsingSuccess) { … }
struct FailureData { … };
class HttpNoVarySearchResponseHeadersParseFailureTest
: public ::testing::Test,
public ::testing::WithParamInterface<FailureData> { … };
TEST_P(HttpNoVarySearchResponseHeadersParseFailureTest,
ParsingFailureOrDefaultValue) { … }
FailureData response_header_failed[] = …;
const TestData response_headers_tests[] = …;
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
struct NoVarySearchCompareTestData { … };
TEST(HttpNoVarySearchCompare, CheckUrlEqualityWithSpecialCharacters) { … }
constexpr std::pair<std::string_view, std::string_view>
kPercentEncodedNonAsciiKeys[] = …;
TEST(HttpNoVarySearchCompare,
CheckUrlEqualityWithPercentEncodedNonASCIICharactersExcept) { … }
TEST(HttpNoVarySearchCompare,
CheckUrlEqualityWithPercentEncodedNonASCIICharacters) { … }
class HttpNoVarySearchCompare
: public ::testing::Test,
public ::testing::WithParamInterface<NoVarySearchCompareTestData> { … };
TEST_P(HttpNoVarySearchCompare, CheckUrlEqualityByNoVarySearch) { … }
const NoVarySearchCompareTestData no_vary_search_compare_tests[] = …;
INSTANTIATE_TEST_SUITE_P(…);
}
}