chromium/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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  // BUILDFLAG(IS_CHROMEOS_LACROS)

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[] =;

// Creates a main-frame navigation request to |url|.
WebRequestInfoInitParams CreateRequestParams(const GURL& url) {}

}  // namespace

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 precedences between extensions.
TEST_F(WebRequestRulesRegistryTest, Precedences) {}

// Test priorities of rules within one extension.
TEST_F(WebRequestRulesRegistryTest, Priorities) {}

// Test ignoring of rules by tag.
TEST_F(WebRequestRulesRegistryTest, IgnoreRulesByTag) {}

// Test that rules failing IsFulfilled on their conditions are never returned by
// GetMatches.
TEST_F(WebRequestRulesRegistryTest, GetMatchesCheckFulfilled) {}

// Test different URL patterns.
TEST_F(WebRequestRulesRegistryTest, GetMatchesDifferentUrls) {}

TEST(WebRequestRulesRegistrySimpleTest, StageChecker) {}

TEST(WebRequestRulesRegistrySimpleTest, HostPermissionsChecker) {}

TEST_F(WebRequestRulesRegistryTest, CheckOriginAndPathRegEx) {}

}  // namespace extensions