#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/url_matcher/url_matcher.h"
#include <stddef.h>
#include <memory>
#include <utility>
#include "base/strings/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
MatcherStringPattern;
namespace url_matcher {
TEST(URLMatcherConditionTest, Constructors) { … }
TEST(URLMatcherSchemeFilter, TestMatching) { … }
TEST(URLMatcherPortFilter, TestMatching) { … }
namespace {
void CreateAndAddCidrBlock(
const std::string& cidr_block,
std::vector<URLMatcherCidrBlockFilter::CidrBlock>& blocks) { … }
}
TEST(URLMatcherCidrBlocksFilter, TestMatching_IPv4) { … }
TEST(URLMatcherCidrBlocksFilter, TestMatching_IPv6) { … }
TEST(URLMatcherConditionTest, IsFullURLCondition) { … }
TEST(URLMatcherConditionTest, IsMatch) { … }
TEST(URLMatcherConditionTest, Comparison) { … }
namespace {
bool Matches(const URLMatcherCondition& condition, const std::string& text) { … }
}
TEST(URLMatcherConditionFactoryTest, GURLCharacterSet) { … }
TEST(URLMatcherConditionFactoryTest, Criteria) { … }
TEST(URLMatcherConditionFactoryTest, TestSingletonProperty) { … }
TEST(URLMatcherConditionFactoryTest, TestComponentSearches) { … }
TEST(URLMatcherConditionFactoryTest, TestFullSearches) { … }
TEST(URLMatcherConditionSetTest, Constructor) { … }
TEST(URLMatcherConditionSetTest, Matching) { … }
namespace {
bool IsQueryMatch(
const std::string& url_query,
const std::string& key,
URLQueryElementMatcherCondition::QueryElementType query_element_type,
const std::string& value,
URLQueryElementMatcherCondition::QueryValueMatchType query_value_match_type,
URLQueryElementMatcherCondition::Type match_type) { … }
}
TEST(URLMatcherConditionSetTest, QueryMatching) { … }
TEST(URLMatcherTest, FullTest) { … }
TEST(URLMatcherTest, TestComponentsImplyContains) { … }
TEST(URLMatcherTest, TestOriginAndPathRegExPositive) { … }
TEST(URLMatcherTest, TestOriginAndPathRegExNegative) { … }
}