#include "chrome/browser/enterprise/signals/client_certificate_fetcher.h"
#include <vector>
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.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/content_settings/core/browser/host_content_settings_map.h"
#include "components/device_signals/core/common/signals_features.h"
#include "content/public/test/browser_task_environment.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/client_cert_identity_test_util.h"
#include "net/ssl/client_cert_store.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/test/cert_test_util.h"
#include "net/test/test_data_directory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace enterprise_signals {
namespace {
const char kRequestingUrl[] = …;
class MockProfileNetworkContextServiceWrapper
: public ProfileNetworkContextServiceWrapper { … };
class MockClientCertStore : public net::ClientCertStore { … };
class FetchCertificateCallbackWrapper { … };
MATCHER_P(CertEqualsIncludingChain, cert, "") { … }
}
class ClientCertificateFetcherTest : public testing::Test,
public testing::WithParamInterface<bool> { … };
TEST_P(ClientCertificateFetcherTest, NoCertStoreImmediatelyCallsBack) { … }
TEST_P(ClientCertificateFetcherTest, EmptyUrl) { … }
TEST_P(ClientCertificateFetcherTest, NoMatchingCertStoreCallsBackNull) { … }
TEST_P(ClientCertificateFetcherTest, ReturnsFirstCertIfMatching) { … }
TEST_P(ClientCertificateFetcherTest, ReturnsSecondCertIfMatching) { … }
TEST_P(ClientCertificateFetcherTest, ReturnsNoCertIfNoFiltersMatch) { … }
TEST_P(ClientCertificateFetcherTest, ReturnsNoCertIfNoFilters) { … }
INSTANTIATE_TEST_SUITE_P(…);
}