#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/blocklist/opt_out_blocklist/opt_out_blocklist.h"
#include <algorithm>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/blocklist/opt_out_blocklist/opt_out_blocklist_delegate.h"
#include "components/blocklist/opt_out_blocklist/opt_out_blocklist_item.h"
#include "components/blocklist/opt_out_blocklist/opt_out_store.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blocklist {
namespace {
const char kTestHost1[] = …;
const char kTestHost2[] = …;
class TestOptOutBlocklistDelegate : public OptOutBlocklistDelegate { … };
class TestOptOutStore : public OptOutStore { … };
class TestOptOutBlocklist : public OptOutBlocklist { … };
class OptOutBlocklistTest : public testing::Test { … };
TEST_F(OptOutBlocklistTest, HostBlockListNoStore) { … }
TEST_F(OptOutBlocklistTest, TypeBlockListWithStore) { … }
TEST_F(OptOutBlocklistTest, TypeBlockListNoStore) { … }
TEST_F(OptOutBlocklistTest, HostIndifferentBlocklist) { … }
TEST_F(OptOutBlocklistTest, QueueBehavior) { … }
TEST_F(OptOutBlocklistTest, MaxHosts) { … }
TEST_F(OptOutBlocklistTest, SingleOptOut) { … }
TEST_F(OptOutBlocklistTest, ClearingBlockListClearsRecentNavigation) { … }
TEST_F(OptOutBlocklistTest, ObserverIsNotifiedOnHostBlocklisted) { … }
TEST_F(OptOutBlocklistTest, ObserverIsNotifiedOnUserBlocklisted) { … }
TEST_F(OptOutBlocklistTest, ObserverIsNotifiedWhenLoadBlocklistDone) { … }
TEST_F(OptOutBlocklistTest, ObserverIsNotifiedOfHistoricalBlocklistedHosts) { … }
TEST_F(OptOutBlocklistTest, PassedReasonsWhenBlocklistDataNotLoaded) { … }
TEST_F(OptOutBlocklistTest, PassedReasonsWhenUserRecentlyOptedOut) { … }
TEST_F(OptOutBlocklistTest, PassedReasonsWhenUserBlocklisted) { … }
TEST_F(OptOutBlocklistTest, PassedReasonsWhenHostBlocklisted) { … }
TEST_F(OptOutBlocklistTest, PassedReasonsWhenAllowed) { … }
}
}