#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/subresource_filter/tools/rule_parser/rule_parser.h"
#include <string>
#include <string_view>
#include <vector>
#include "components/subresource_filter/tools/rule_parser/rule.h"
#include "components/subresource_filter/tools/rule_parser/rule_options.h"
#include "components/url_pattern_index/proto/rules.pb.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace subresource_filter {
namespace {
void ParseAndExpectUrlRule(std::string_view line,
const UrlRule& expected_rule) { … }
void ParseAndExpectCssRule(std::string_view line,
const CssRule& expected_rule) { … }
}
TEST(RuleParserTest, ParseComment) { … }
TEST(RuleParserTest, ParseUrlRule) { … }
TEST(RuleParserTest, UrlRuleMatchCase) { … }
TEST(RuleParserTest, ParseAllowlistUrlRule) { … }
TEST(RuleParserTest, ParseEmptyOptions) { … }
TEST(RuleParserTest, ParseSingleTypeOptions) { … }
TEST(RuleParserTest, ParseSingleInverseTypeOptions) { … }
TEST(RuleParserTest, ParseMultipleTypeOptions) { … }
TEST(RuleParserTest, ParseContradictingTypeOptions) { … }
TEST(RuleParserTest, ParseUrlRuleOptions) { … }
TEST(RuleParserTest, ParseUrlRuleAnchors) { … }
TEST(RuleParserTest, ParseUrlRuleWithBookmark) { … }
TEST(RuleParserTest, ParseUrlRuleWithElementAndActivationTypes) { … }
TEST(RuleParserTest, ParseUrlRuleWithRegexp) { … }
TEST(RuleParserTest, ParseCssRules) { … }
TEST(RuleParserTest, ParseErrors) { … }
TEST(RuleParserTest, ParseNonEmptyUrlRuleWithEmptyUrlPattern) { … }
}