#include "components/subresource_filter/content/shared/browser/ruleset_publisher.h"
#include <stddef.h>
#include <string>
#include <tuple>
#include <utility>
#include "base/containers/span.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/numerics/safe_conversions.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner.h"
#include "base/test/test_simple_task_runner.h"
#include "components/prefs/testing_pref_service.h"
#include "components/subresource_filter/content/shared/browser/ruleset_service.h"
#include "components/subresource_filter/core/common/constants.h"
#include "components/subresource_filter/core/common/test_ruleset_creator.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
#include "ipc/ipc_platform_file.h"
#include "ipc/ipc_test_sink.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
class RenderProcessHost;
}
namespace subresource_filter {
namespace {
MockClosureTarget;
class NotifyingMockRenderProcessHost : public content::MockRenderProcessHost { … };
std::string ReadFileContentsToString(base::File* file) { … }
}
class SubresourceFilterRulesetPublisherTest : public ::testing::Test { … };
class MockRulesetPublisher : public RulesetPublisher { … };
TEST_F(SubresourceFilterRulesetPublisherTest, NoRuleset_NoIPCMessages) { … }
TEST_F(SubresourceFilterRulesetPublisherTest,
PublishedRuleset_IsDistributedToExistingAndNewRenderers) { … }
TEST_F(SubresourceFilterRulesetPublisherTest,
PublishesRulesetInOnePostTask) { … }
}