#include "components/subresource_filter/tools/ruleset_converter/ruleset_test_util.h"
#include <fstream>
#include <ios>
#include <istream>
#include "base/files/file_util.h"
#include "components/subresource_filter/tools/rule_parser/rule_parser.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace subresource_filter {
TestRulesetContents::TestRulesetContents() = default;
TestRulesetContents::~TestRulesetContents() = default;
TestRulesetContents::TestRulesetContents(const TestRulesetContents& other)
: … { … }
void TestRulesetContents::AppendRules(
const std::vector<std::string>& text_rules,
bool allow_errors) { … }
void TestRulesetContents::AppendParsedRules(const TestRulesetContents& other) { … }
bool TestRulesetContents::operator==(const TestRulesetContents& other) const { … }
std::ostream& operator<<(std::ostream& out,
const TestRulesetContents& contents) { … }
ScopedTempRulesetFile::ScopedTempRulesetFile(RulesetFormat format)
: … { … }
ScopedTempRulesetFile::~ScopedTempRulesetFile() = default;
std::unique_ptr<RuleOutputStream> ScopedTempRulesetFile::OpenForOutput() const { … }
std::unique_ptr<RuleInputStream> ScopedTempRulesetFile::OpenForInput() const { … }
void ScopedTempRulesetFile::WriteRuleset(
const TestRulesetContents& contents) const { … }
TestRulesetContents ScopedTempRulesetFile::ReadContents() const { … }
bool AreUrlRulesEqual(const url_pattern_index::proto::UrlRule& first,
const url_pattern_index::proto::UrlRule& second) { … }
bool AreCssRulesEqual(const url_pattern_index::proto::CssRule& first,
const url_pattern_index::proto::CssRule& second) { … }
}