#include "components/url_rewrite/browser/url_request_rewrite_rules_validation.h"
#include <string_view>
#include "base/run_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace url_rewrite {
namespace {
mojom::UrlRequestActionPtr CreateRewriteAddHeaders(
std::string_view header_name,
std::string_view header_value) { … }
mojom::UrlRequestActionPtr CreateRewriteRemoveHeader(
std::optional<std::string_view> query_pattern,
std::string_view header_name) { … }
mojom::UrlRequestActionPtr CreateRewriteSubstituteQueryPattern(
std::string_view pattern,
std::string_view substitution) { … }
mojom::UrlRequestActionPtr CreateRewriteReplaceUrl(
std::string_view url_ends_with,
std::string_view new_url) { … }
mojom::UrlRequestActionPtr CreateRewriteAppendToQuery(std::string_view query) { … }
bool ValidateRulesFromAction(mojom::UrlRequestActionPtr action) { … }
}
TEST(UrlRequestRewriteRulesValidationTest, ValidateAddHeaders) { … }
TEST(UrlRequestRewriteRulesValidationTest, ValidateRemoveHeader) { … }
TEST(UrlRequestRewriteRulesValidationTest, ValidateSubstituteQueryPattern) { … }
TEST(UrlRequestRewriteRulesValidationTest, ValidateReplaceUrl) { … }
TEST(UrlRequestRewriteRulesValidationTest, ValidateAppendToQuery) { … }
TEST(UrlRequestRewriteRulesValidationTest, ValidateNullAction) { … }
TEST(UrlRequestRewriteRulesValidationTest, ValidateNullRules) { … }
}