#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/safe_search_api/url_checker.h"
#include <stddef.h>
#include <algorithm>
#include <iterator>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "components/safe_search_api/fake_url_checker_client.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
_;
namespace safe_search_api {
namespace {
constexpr size_t kCacheSize = …;
const char* kURLs[] = …;
ClientClassification ToAPIClassification(Classification classification,
bool uncertain) { … }
auto Recorded(const std::map<CacheAccessStatus, int>& expected) { … }
}
class SafeSearchURLCheckerTest : public testing::Test { … };
TEST_F(SafeSearchURLCheckerTest, Simple) { … }
TEST_F(SafeSearchURLCheckerTest, Cache) { … }
TEST_F(SafeSearchURLCheckerTest, CoalesceRequestsToSameURL) { … }
TEST_F(SafeSearchURLCheckerTest, CacheTimeout) { … }
TEST_F(SafeSearchURLCheckerTest, DoNotCacheUncertainClassifications) { … }
TEST_F(SafeSearchURLCheckerTest, DestroyURLCheckerBeforeCallback) { … }
}