chromium/components/subresource_filter/core/common/ruleset_dealer_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.

#include "components/subresource_filter/core/common/ruleset_dealer.h"

#include <memory>
#include <vector>

#include "base/files/file.h"
#include "components/subresource_filter/core/common/memory_mapped_ruleset.h"
#include "components/subresource_filter/core/common/test_ruleset_creator.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace subresource_filter {

namespace {

const char kTestRulesetSuffix1[] =;
const char kTestRulesetSuffix2[] =;

std::vector<uint8_t> ReadRulesetContents(const MemoryMappedRuleset* ruleset) {}

}  // namespace

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

TEST_F(SubresourceFilterRulesetDealerTest, NoRuleset) {}

TEST_F(SubresourceFilterRulesetDealerTest, MostRecentlySetRulesetIsReturned) {}

TEST_F(SubresourceFilterRulesetDealerTest,
       MemoryMappedRulesetIsCachedAndReused) {}

TEST_F(SubresourceFilterRulesetDealerTest, RulesetIsMemoryMappedLazily) {}

TEST_F(SubresourceFilterRulesetDealerTest, RulesetIsUnmappedEagerly) {}

TEST_F(SubresourceFilterRulesetDealerTest, RulesetIsUnmappedAndRemapped) {}

TEST_F(SubresourceFilterRulesetDealerTest, NewRulesetIsMappedLazilyOnUpdate) {}

// If the last reference to the old version of the ruleset is dropped after the
// the version is already cached, that should have no effect on caching.
TEST_F(SubresourceFilterRulesetDealerTest,
       NewRulesetRemainsCachedAfterOldRulesetIsUnmapped) {}

TEST_F(SubresourceFilterRulesetDealerTest,
       RulesetDealerDestroyedBeforeRuleset) {}

TEST_F(SubresourceFilterRulesetDealerTest, MmapFailure) {}

}  // namespace subresource_filter