#ifndef EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_TEST_UTILS_H_
#define EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_TEST_UTILS_H_
#include <optional>
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/values.h"
#include "extensions/common/api/declarative_net_request/constants.h"
#include "extensions/common/url_pattern.h"
namespace extensions::declarative_net_request {
inline constexpr char kManifestSandboxPageFilepath[] = …;
struct DictionarySource { … };
struct TestHeaderCondition : public DictionarySource { … };
struct TestRuleCondition : public DictionarySource { … };
struct TestRuleQueryKeyValue : public DictionarySource { … };
struct TestRuleQueryTransform : public DictionarySource { … };
struct TestRuleTransform : public DictionarySource { … };
struct TestRuleRedirect : public DictionarySource { … };
struct TestHeaderInfo : public DictionarySource { … };
struct TestRuleAction : public DictionarySource { … };
struct TestRule : public DictionarySource { … };
TestRule CreateGenericRule(int id = kMinValidID);
TestRule CreateRegexRule(int id = kMinValidID);
enum ConfigFlag { … };
struct TestRulesetInfo { … };
base::Value::Dict CreateManifest(
const std::vector<TestRulesetInfo>& ruleset_info,
const std::vector<std::string>& hosts = { … };
base::Value::List ToListValue(const std::vector<std::string>& vec);
base::Value::List ToListValue(const std::vector<TestRule>& rules);
void WriteManifestAndRulesets(
const base::FilePath& extension_dir,
const std::vector<TestRulesetInfo>& ruleset_info,
const std::vector<std::string>& hosts,
unsigned flags = ConfigFlag::kConfig_None,
const std::string& extension_name = "Test Extension");
void WriteManifestAndRuleset(
const base::FilePath& extension_dir,
const TestRulesetInfo& ruleset_info,
const std::vector<std::string>& hosts,
unsigned flags = ConfigFlag::kConfig_None,
const std::string& extension_name = "Test Extension");
}
#endif