chromium/components/subresource_filter/core/browser/async_document_subresource_filter_unittest.cc

// 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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/subresource_filter/core/browser/async_document_subresource_filter.h"

#include <memory>
#include <vector>

#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/test/test_simple_task_runner.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/load_policy.h"
#include "components/subresource_filter/core/common/memory_mapped_ruleset.h"
#include "components/subresource_filter/core/common/test_ruleset_creator.h"
#include "components/subresource_filter/core/common/test_ruleset_utils.h"
#include "components/url_pattern_index/proto/rules.pb.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace subresource_filter {

proto;

class AsyncDocumentSubresourceFilterTest : public ::testing::Test {};

namespace {

// TODO(csharrison): If more consumers need to test these callbacks at this
// granularity, consider moving these classes into
// async_document_subresource_filter_test_utils.
class TestCallbackReceiver {};

class LoadPolicyCallbackReceiver {};

class MultiLoadPolicyCallbackReceiver {};

}  // namespace

TEST_F(AsyncDocumentSubresourceFilterTest, ActivationStateIsReported) {}

TEST_F(AsyncDocumentSubresourceFilterTest, DeleteFilter_NoActivationCallback) {}

TEST_F(AsyncDocumentSubresourceFilterTest, ActivationStateIsComputedCorrectly) {}

TEST_F(AsyncDocumentSubresourceFilterTest, DisabledForCorruptRuleset) {}

TEST_F(AsyncDocumentSubresourceFilterTest, GetLoadPolicyForSubdocument) {}

TEST_F(AsyncDocumentSubresourceFilterTest, GetLoadPolicyForSubdocumentURLs) {}

TEST_F(AsyncDocumentSubresourceFilterTest, FirstDisallowedLoadIsReported) {}

TEST_F(AsyncDocumentSubresourceFilterTest, UpdateActivationState) {}

// Tests the second constructor.
TEST_F(AsyncDocumentSubresourceFilterTest,
       ActivationStateProvided_ActivationStateImmediatelyAvailable) {}

// Tests for ComputeActivationState:

class SubresourceFilterComputeActivationStateTest : public ::testing::Test {};

TEST_F(SubresourceFilterComputeActivationStateTest,
       ActivationBitsCorrectlyPropagateToChildDocument) {}

}  // namespace subresource_filter