#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "extensions/browser/api/declarative_webrequest/webrequest_rules_registry.h"
#include <stddef.h>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/run_loop.h"
#include "base/test/values_test_util.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "chrome/common/extensions/extension_test_util.h"
#include "chrome/test/base/testing_profile.h"
#include "components/url_matcher/url_matcher_constants.h"
#include "content/public/test/browser_task_environment.h"
#include "extensions/browser/api/declarative/rules_registry_service.h"
#include "extensions/browser/api/declarative_webrequest/webrequest_constants.h"
#include "extensions/browser/api/web_request/permission_helper.h"
#include "extensions/browser/api/web_request/web_request_api_helpers.h"
#include "extensions/browser/api/web_request/web_request_info.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "services/network/public/mojom/fetch_api.mojom-shared.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest-message.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/lacros/lacros_test_helper.h"
#endif
helpers;
keys;
keys2;
Value;
LoadManifest;
LoadManifestUnchecked;
EventResponseDelta;
EventResponseDeltas;
HasSubstr;
URLMatcher;
namespace extensions {
namespace {
const char kExtensionId[] = …;
const char kExtensionId2[] = …;
const char kRuleId1[] = …;
const char kRuleId2[] = …;
const char kRuleId3[] = …;
const char kRuleId4[] = …;
WebRequestInfoInitParams CreateRequestParams(const GURL& url) { … }
}
class TestWebRequestRulesRegistry : public WebRequestRulesRegistry { … };
class WebRequestRulesRegistryTest : public testing::Test { … };
void WebRequestRulesRegistryTest::SetUp() { … }
TEST_F(WebRequestRulesRegistryTest, AddRulesImpl) { … }
TEST_F(WebRequestRulesRegistryTest, RemoveRulesImpl) { … }
TEST_F(WebRequestRulesRegistryTest, RemoveAllRulesImpl) { … }
TEST_F(WebRequestRulesRegistryTest, Precedences) { … }
TEST_F(WebRequestRulesRegistryTest, Priorities) { … }
TEST_F(WebRequestRulesRegistryTest, IgnoreRulesByTag) { … }
TEST_F(WebRequestRulesRegistryTest, GetMatchesCheckFulfilled) { … }
TEST_F(WebRequestRulesRegistryTest, GetMatchesDifferentUrls) { … }
TEST(WebRequestRulesRegistrySimpleTest, StageChecker) { … }
TEST(WebRequestRulesRegistrySimpleTest, HostPermissionsChecker) { … }
TEST_F(WebRequestRulesRegistryTest, CheckOriginAndPathRegEx) { … }
}