chromium/services/network/trust_tokens/trust_token_store_unittest.cc

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

#include "services/network/trust_tokens/trust_token_store.h"

#include <map>
#include <memory>
#include <utility>

#include "base/functional/bind.h"
#include "base/test/protobuf_matchers.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "services/network/public/cpp/trust_token_parameterization.h"
#include "services/network/public/mojom/clear_data_filter.mojom.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/trust_tokens/in_memory_trust_token_persister.h"
#include "services/network/trust_tokens/proto/public.pb.h"
#include "services/network/trust_tokens/proto/storage.pb.h"
#include "services/network/trust_tokens/suitable_trust_token_origin.h"
#include "services/network/trust_tokens/trust_token_parameterization.h"
#include "services/network/trust_tokens/types.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"

EqualsProto;
ElementsAre;
Optional;

namespace network::trust_tokens {

TEST(TrustTokenStoreTest, RecordsIssuances) {}

TEST(TrustTokenStoreTest, DoesntReportMissingIssuanceTimestamps) {}

TEST(TrustTokenStoreTest, DoesntReportNegativeTimeSinceLastIssuance) {}

TEST(TrustTokenStoreTest, DoesntReportNegativeTimeSinceLastRedemption) {}

TEST(TrustTokenStore, AssociatesToplevelsWithIssuers) {}

// Test that issuer-toplevel association works correctly when a toplevel's
// number-of-issuance cap has been reached: reassocating an already-associated
// issuer should succeed, while associating any other issuer should fail.
TEST(TrustTokenStore, IssuerToplevelAssociationAtNumberOfAssociationsCap) {}

TEST(TrustTokenStore, AddingTokensRespectsCapacity) {}

TEST(TrustTokenStore, CountsTokens) {}

TEST(TrustTokenStore, GetsAllStoredTokens) {}

TEST(TrustTokenStore, GetsAllRedemptionRecordsByIssuerToplevelPair) {}

TEST(TrustTokenStore, PrunesDataAssociatedWithRemovedKeyCommitments) {}

TEST(TrustTokenStore, AddsTrustTokens) {}

TEST(TrustTokenStore, RetrievesTrustTokensRespectingNontrivialPredicate) {}

TEST(TrustTokenStore, DeletesSingleToken) {}

TEST(TrustTokenStore, DeleteTokenForMissingIssuer) {}

TEST(TrustTokenStore, SetsAndRetrievesRedemptionRecord) {}

TEST(TrustTokenStore, RetrieveRedemptionRecordHandlesConfigWithNoRecord) {}

TEST(TrustTokenStore, SetRedemptionRecordOverwritesExisting) {}

namespace {
// Characterizes an RR as expired if its body begins with an "a".
class LetterAExpiringExpiryDelegate
    : public TrustTokenStore::RecordExpiryDelegate {};
}  // namespace

TEST(TrustTokenStore, DoesNotReturnStaleRedemptionRecord) {}

TEST(TrustTokenStore, EmptyFilter) {}

TEST(TrustTokenStore, EmptyFilterInKeepMatchesMode) {}

TEST(TrustTokenStore, ClearsIssuerKeyedData) {}

TEST(TrustTokenStore, ClearsToplevelKeyedData) {}

TEST(TrustTokenStore, ClearsIssuerToplevelPairKeyedData) {}

TEST(TrustTokenStore, ClearDataCanFilterByDomain) {}

TEST(TrustTokenStore, RemovesDataForInvertedFilters) {}

TEST(TrustTokenStore, RemovesDataForNullFilter) {}

TEST(TrustTokenStore, RemovesTrustTokensByIssuer) {}

TEST(TrustTokenStore, RemoveReturnsFalseWhenNoTrustTokensAreDeleted) {}

TEST(TrustTokenStore, RemovesTrustTokensByIssuerAndKeepsOthers) {}

TEST(TrustTokenStore, RedemptionLimit) {}

TEST(TrustTokenStore, ClearDataForPredicate) {}

}  // namespace network::trust_tokens