chromium/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/memory/raw_ptr.h"
#include "chrome/browser/safe_browsing/chrome_client_side_detection_service_delegate.h"

#include <stdint.h>

#include <map>
#include <memory>
#include <string>

#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/metrics/field_trial.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/chromeos_buildflags.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/optimization_guide/core/test_model_info_builder.h"
#include "components/optimization_guide/core/test_optimization_guide_model_provider.h"
#include "components/safe_browsing/content/browser/client_side_detection_service.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/proto/client_model.pb.h"
#include "components/safe_browsing/core/common/proto/csd.pb.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/safe_browsing/core/common/safebrowsing_constants.h"
#include "components/variations/variations_associated_data.h"
#include "content/public/test/browser_task_environment.h"
#include "crypto/sha2.h"
#include "net/http/http_status_code.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/ash/components/install_attributes/stub_install_attributes.h"
#endif

Invoke;
Mock;
StrictMock;
_;
BrowserThread;

namespace safe_browsing {

class ClientSidePhishingModelObserverTracker
    : public optimization_guide::TestOptimizationGuideModelProvider {};

class ClientSideDetectionServiceTest
    : public testing::Test,
      public testing::WithParamInterface<bool> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(ClientSideDetectionServiceTest, ServiceObjectDeletedBeforeCallbackDone) {}

TEST_P(ClientSideDetectionServiceTest, SendClientReportPhishingRequest) {}

TEST_P(ClientSideDetectionServiceTest,
       SendClientReportPhishingRequestWithToken) {}

TEST_P(ClientSideDetectionServiceTest,
       SendClientReportPhishingRequestWithoutToken) {}

TEST_P(ClientSideDetectionServiceTest, GetNumReportTest) {}

TEST_P(ClientSideDetectionServiceTest, GetNumReportAtLimitWhenProfileIsNull) {}

TEST_P(ClientSideDetectionServiceTest,
       GetNumReportTestWhenPrefsPreloadedAndOverLimit) {}

TEST_P(ClientSideDetectionServiceTest,
       GetNumReportTestWhenPrefsPreloadedNotOverLimit) {}

TEST_P(ClientSideDetectionServiceTest, GetNumReportTestESB) {}

TEST_P(ClientSideDetectionServiceTest, CacheTest) {}

TEST_P(ClientSideDetectionServiceTest, IsPrivateIPAddress) {}

TEST_P(ClientSideDetectionServiceTest, IsLocalResource) {}

TEST_P(ClientSideDetectionServiceTest, TestModelFollowsPrefs) {}

TEST_P(ClientSideDetectionServiceTest,
       TestReceivingImageEmbedderUpdatesAfterResubscription) {}

}  // namespace safe_browsing