#include "components/subresource_filter/content/shared/browser/activation_state_computing_navigation_throttle.h"
#include <memory>
#include <optional>
#include <utility>
#include <vector>
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/test_simple_task_runner.h"
#include "components/subresource_filter/content/shared/common/subresource_filter_utils.h"
#include "components/subresource_filter/core/browser/async_document_subresource_filter.h"
#include "components/subresource_filter/core/browser/async_document_subresource_filter_test_utils.h"
#include "components/subresource_filter/core/common/constants.h"
#include "components/subresource_filter/core/common/scoped_timers.h"
#include "components/subresource_filter/core/common/test_ruleset_creator.h"
#include "components/subresource_filter/core/common/test_ruleset_utils.h"
#include "components/subresource_filter/core/mojom/subresource_filter.mojom.h"
#include "components/url_pattern_index/proto/rules.pb.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace subresource_filter {
proto;
class ActivationStateComputingNavigationThrottleTest
: public content::RenderViewHostTestHarness,
public content::WebContentsObserver,
public ::testing::WithParamInterface<bool> { … };
ActivationStateComputingThrottleMainFrameTest;
ActivationStateComputingThrottleSubFrameTest;
TEST_P(ActivationStateComputingThrottleMainFrameTest, Activate) { … }
TEST_P(ActivationStateComputingThrottleMainFrameTest,
NoPageActivationNotification_NoActivation) { … }
TEST_P(ActivationStateComputingThrottleMainFrameTest,
AllowlistDoesNotApply_CausesActivation) { … }
TEST_P(ActivationStateComputingThrottleMainFrameTest,
Allowlisted_DisablesFiltering) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest, Activate) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest,
AllowlistDoesNotApply_CausesActivation) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest,
Allowlisted_DisableDocumentFiltering) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest,
Allowlisted_DisablesGenericRules) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest, DryRunIsPropagated) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest,
DryRunWithLoggingIsPropagated) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest, DisabledStatePropagated) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest, DisabledStatePropagated2) { … }
TEST_P(ActivationStateComputingThrottleSubFrameTest, SpeculationWithDelay) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}