#include "chrome/browser/supervised_user/classify_url_navigation_throttle.h"
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/safe_search_api/fake_url_checker_client.h"
#include "components/supervised_user/core/browser/supervised_user_service.h"
#include "components/supervised_user/core/browser/supervised_user_url_filter.h"
#include "components/supervised_user/core/browser/supervised_user_utils.h"
#include "components/supervised_user/core/common/supervised_user_constants.h"
#include "components/supervised_user/test_support/kids_management_api_server_mock.h"
#include "components/supervised_user/test_support/supervised_user_url_filter_test_utils.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/navigation_simulator.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace supervised_user {
namespace {
static const char* kExampleURL = …;
class MockSupervisedUserURLFilter : public SupervisedUserURLFilter { … };
}
class ClassifyUrlNavigationThrottleTest
: public ChromeRenderViewHostTestHarness { … };
TEST_F(ClassifyUrlNavigationThrottleTest, AllowedUrlsRecordedInAllowBucket) { … }
TEST_F(ClassifyUrlNavigationThrottleTest,
BlocklistedUrlsRecordedInBlockManualBucket) { … }
TEST_F(ClassifyUrlNavigationThrottleTest,
AllSitesBlockedRecordedInBlockNotInAllowlistBucket) { … }
TEST_F(ClassifyUrlNavigationThrottleTest,
BlockedMatureSitesRecordedInBlockSafeSitesBucket) { … }
TEST_F(ClassifyUrlNavigationThrottleTest, ClassificationIsFasterThanHttp) { … }
TEST_F(ClassifyUrlNavigationThrottleTest, ClassificationIsSlowerThanHttp) { … }
TEST_F(ClassifyUrlNavigationThrottleTest, ShortCircuitsSynchronousBlock) { … }
TEST_F(ClassifyUrlNavigationThrottleTest, HandlesLateAsynchronousBlock) { … }
}