#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "extensions/browser/api/declarative_net_request/composite_matcher.h"
#include <string>
#include <utility>
#include <vector>
#include "base/memory/raw_ref.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "components/version_info/channel.h"
#include "extensions/browser/api/declarative_net_request/constants.h"
#include "extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h"
#include "extensions/browser/api/declarative_net_request/request_action.h"
#include "extensions/browser/api/declarative_net_request/request_params.h"
#include "extensions/browser/api/declarative_net_request/ruleset_matcher.h"
#include "extensions/browser/api/declarative_net_request/test_utils.h"
#include "extensions/common/api/declarative_net_request.h"
#include "extensions/common/api/declarative_net_request/constants.h"
#include "extensions/common/api/declarative_net_request/test_utils.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/features/feature_channel.h"
#include "extensions/common/permissions/permissions_data.h"
#include "net/http/http_request_headers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace extensions::declarative_net_request {
namespace {
PageAccess;
ActionInfo;
dnr_api;
CompositeMatcherTest;
TestRule CreateModifyHeadersRule(
int id,
int priority,
std::optional<std::string> url_filter,
std::optional<std::string> regex_filter,
std::optional<std::vector<TestHeaderInfo>> request_headers_list,
std::optional<std::vector<TestHeaderInfo>> response_headers_list) { … }
TEST_F(CompositeMatcherTest, SamePrioritySpace) { … }
TEST_F(CompositeMatcherTest, GetModifyHeadersActions) { … }
TEST_F(CompositeMatcherTest, GetModifyHeadersActions_Priority) { … }
TEST_F(CompositeMatcherTest, NotifyWithholdFromPageAccess) { … }
TEST_F(CompositeMatcherTest, HostPermissionsAlwaysRequired) { … }
TEST_F(CompositeMatcherTest, GetRedirectUrlFromPriority) { … }
TEST_F(CompositeMatcherTest, RulePlacement) { … }
class CompositeMatcherResponseHeadersTest : public CompositeMatcherTest { … };
TEST_F(CompositeMatcherResponseHeadersTest, AllowRuleMatchedAcrossStages) { … }
}
}