#ifndef COMPONENTS_URL_PATTERN_INDEX_URL_RULE_TEST_SUPPORT_H_
#define COMPONENTS_URL_PATTERN_INDEX_URL_RULE_TEST_SUPPORT_H_
#include <string>
#include <string_view>
#include <vector>
#include "components/url_pattern_index/proto/rules.pb.h"
#include "components/url_pattern_index/url_pattern.h"
class GURL;
namespace url {
class Origin;
}
namespace url_pattern_index {
namespace testing {
constexpr proto::UrlPatternType kSubstring = …;
constexpr proto::AnchorType kAnchorNone = …;
constexpr proto::AnchorType kBoundary = …;
constexpr proto::AnchorType kSubdomain = …;
constexpr proto::ElementType kNoElement = …;
constexpr proto::ElementType kOther = …;
constexpr proto::ElementType kScript = …;
constexpr proto::ElementType kImage = …;
constexpr proto::ElementType kSubdocument = …;
constexpr proto::ElementType kFont = …;
constexpr proto::ElementType kPopup = …;
constexpr proto::ElementType kWebSocket = …;
constexpr proto::ElementType kAllElementTypes = …;
constexpr proto::ActivationType kNoActivation = …;
constexpr proto::ActivationType kDocument = …;
constexpr proto::ActivationType kGenericBlock = …;
constexpr proto::SourceType kAnyParty = …;
constexpr proto::SourceType kThirdParty = …;
constexpr proto::SourceType kFirstParty = …;
proto::UrlRule MakeUrlRule(const UrlPattern& url_pattern = UrlPattern());
void AddInitiatorDomains(const std::vector<std::string>& initiator_domains,
proto::UrlRule* rule);
void AddRequestDomains(const std::vector<std::string>& request_domains,
proto::UrlRule* rule);
url::Origin GetOrigin(std::string_view origin_string);
bool IsThirdParty(const GURL& url, const url::Origin& first_party_origin);
}
}
#endif