#include "content/browser/aggregation_service/aggregation_service_key_fetcher.h"
#include <memory>
#include <optional>
#include <string_view>
#include <utility>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "base/time/clock.h"
#include "base/time/time.h"
#include "content/browser/aggregation_service/aggregation_service_storage.h"
#include "content/browser/aggregation_service/aggregation_service_test_utils.h"
#include "content/browser/aggregation_service/public_key.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace content {
namespace {
_;
DoAll;
FetchCallback;
NetworkFetchCallback;
constexpr std::string_view kExampleUrl = …;
class MockNetworkFetcher : public AggregationServiceKeyFetcher::NetworkFetcher { … };
}
class AggregationServiceKeyFetcherTest : public testing::Test { … };
TEST_F(AggregationServiceKeyFetcherTest, GetPublicKeysFromStorage_Succeed) { … }
TEST_F(AggregationServiceKeyFetcherTest, GetPublicKeysWithNoKeysForUrl_Failed) { … }
TEST_F(AggregationServiceKeyFetcherTest, FetchPublicKeysFromNetwork_Succeed) { … }
TEST_F(AggregationServiceKeyFetcherTest,
FetchPublicKeysFromNetworkNoStore_NotStored) { … }
TEST_F(AggregationServiceKeyFetcherTest,
FetchPublicKeysFromNetworkError_StorageCleared) { … }
TEST_F(AggregationServiceKeyFetcherTest,
SimultaneousFetches_NoDuplicateNetworkRequest) { … }
TEST_F(AggregationServiceKeyFetcherTest,
SimultaneousFetchesInvalidKeysFromNetwork_NoDuplicateNetworkRequest) { … }
TEST_F(AggregationServiceKeyFetcherTest,
KeyFetcherDeleted_PendingRequestsNotRun) { … }
}