chromium/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h

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

#ifndef CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_BROWSER_TEST_HARNESS_H_
#define CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_BROWSER_TEST_HARNESS_H_

#include <memory>
#include <string>
#include <string_view>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/test/base/platform_browser_test.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/infobars/core/infobar.h"
#include "components/safe_browsing/core/browser/db/util.h"
#include "components/subresource_filter/content/browser/subresource_filter_observer.h"
#include "components/subresource_filter/content/browser/subresource_filter_observer_manager.h"
#include "components/subresource_filter/content/browser/subresource_filter_profile_context.h"
#include "components/subresource_filter/content/browser/test_ruleset_publisher.h"
#include "components/subresource_filter/core/browser/subresource_filter_features_test_support.h"
#include "components/subresource_filter/core/common/test_ruleset_creator.h"
#include "components/url_pattern_index/proto/rules.pb.h"
#include "content/public/test/fenced_frame_test_util.h"
#include "content/public/test/prerender_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "url/gurl.h"

proto;

ScopedSubresourceFilterConfigurator;
TestRulesetPublisher;
TestRulesetCreator;
TestRulesetPair;

namespace content {
class NavigationHandle;
class RenderFrameHost;
class WebContents;
}  // namespace content

class TestSafeBrowsingDatabaseHelper;

namespace subresource_filter {

class AdsInterventionManager;
class SubresourceFilterContentSettingsManager;
class RulesetService;

// Small helper mock to allow tests to set expectations about observations on
// the subresource filter. Automatically registers and unregisters itself as an
// observer for its lifetime.
class MockSubresourceFilterObserver : public SubresourceFilterObserver {};

// Matchers for mojom::ActivationState arguments.
MATCHER(HasActivationLevelDisabled, "") {}
MATCHER(HasActivationLevelDryRun, "") {}
MATCHER(HasActivationLevelEnabled, "") {}

// Class for shared test harness functionality to be used for both safe browsing
// and fingerprinting protection browser tests.
class SubresourceFilterSharedBrowserTest : public PlatformBrowserTest {};

class SubresourceFilterBrowserTest : public SubresourceFilterSharedBrowserTest {};

// This class automatically syncs the SubresourceFilter SafeBrowsing list
// without needing a chrome branded build.
class SubresourceFilterListInsertingBrowserTest
    : public SubresourceFilterBrowserTest {};

class SubresourceFilterPrerenderingBrowserTest
    : public SubresourceFilterListInsertingBrowserTest {};

class SubresourceFilterFencedFrameBrowserTest
    : public SubresourceFilterListInsertingBrowserTest {};

}  // namespace subresource_filter

#endif  // CHROME_BROWSER_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_BROWSER_TEST_HARNESS_H_