#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "extensions/browser/api/declarative_net_request/ruleset_matcher.h"
#include <limits>
#include <optional>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "components/url_pattern_index/flat/url_pattern_index_generated.h"
#include "components/version_info/channel.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.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/test_utils.h"
#include "extensions/browser/api/declarative_net_request/utils.h"
#include "extensions/browser/extensions_test.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 "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace extensions::declarative_net_request {
namespace {
dnr_api;
RulesetMatcherTest;
TEST_F(RulesetMatcherTest, BlockingRule) { … }
TEST_F(RulesetMatcherTest, RedirectRule) { … }
TEST_F(RulesetMatcherTest, PreventSelfRedirect) { … }
TEST_F(RulesetMatcherTest, UpgradeRule) { … }
TEST_F(RulesetMatcherTest, FailedVerification) { … }
TEST_F(RulesetMatcherTest, ModifyHeaders_IsExtraHeaderMatcher) { … }
TEST_F(RulesetMatcherTest, ModifyHeaders) { … }
TEST_F(RulesetMatcherTest, RedirectToExtensionPath) { … }
TEST_F(RulesetMatcherTest, RedirectToStaticUrl) { … }
TEST_F(RulesetMatcherTest, UrlTransform) { … }
TEST_F(RulesetMatcherTest, RegexRules) { … }
TEST_F(RulesetMatcherTest, RegexRules_Metadata) { … }
TEST_F(RulesetMatcherTest, RegexAndFilterListRules_RedirectPriority) { … }
TEST_F(RulesetMatcherTest, RegexAndFilterListRules_ModifyHeaders) { … }
TEST_F(RulesetMatcherTest, RegexSubstitution) { … }
TEST_F(RulesetMatcherTest, RulesCount) { … }
TEST_F(RulesetMatcherTest, BreakTiesByActionPriority) { … }
AllowAllRequestsTest;
TEST_F(AllowAllRequestsTest, AllowlistedFrameTracking) { … }
TEST_F(AllowAllRequestsTest, GetBeforeRequestAction) { … }
TEST_F(RulesetMatcherTest, SetDisabledRuleIds) { … }
class RulesetMatcherResponseHeadersTest : public RulesetMatcherTest { … };
TEST_F(RulesetMatcherResponseHeadersTest, OnHeadersReceivedAction) { … }
TEST_F(RulesetMatcherResponseHeadersTest, OnHeadersReceivedAction_Regex) { … }
TEST_F(RulesetMatcherResponseHeadersTest, MatchOnResponseHeaders) { … }
}
}