chromium/net/third_party/quiche/src/quiche/quic/core/crypto/quic_client_session_cache_test.cc

// Copyright (c) 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "quiche/quic/core/crypto/quic_client_session_cache.h"

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/mock_clock.h"
#include "quiche/common/quiche_text_utils.h"

namespace quic {
namespace test {
namespace {

const QuicTime::Delta kTimeout =;
const QuicVersionLabel kFakeVersionLabel =;
const QuicVersionLabel kFakeVersionLabel2 =;
const uint64_t kFakeIdleTimeoutMilliseconds =;
const uint8_t kFakeStatelessResetTokenData[16] =;
const uint64_t kFakeMaxPacketSize =;
const uint64_t kFakeInitialMaxData =;
const bool kFakeDisableMigration =;
const auto kCustomParameter1 =;
const char* kCustomParameter1Value =;
const auto kCustomParameter2 =;
const char* kCustomParameter2Value =;

std::vector<uint8_t> CreateFakeStatelessResetToken() {}

TransportParameters::LegacyVersionInformation
CreateFakeLegacyVersionInformation() {}

TransportParameters::VersionInformation CreateFakeVersionInformation() {}

// Make a TransportParameters that has a few fields set to help test comparison.
std::unique_ptr<TransportParameters> MakeFakeTransportParams() {}

// Generated by running TlsClientHandshakerTest.ZeroRttResumption and in
// TlsClientHandshaker::InsertSession calling SSL_SESSION_to_bytes to serialize
// the received 0-RTT capable ticket.
static const char kCachedSession[] =;

class QuicClientSessionCacheTest : public QuicTest {};

// Tests that simple insertion and lookup work correctly.
TEST_F(QuicClientSessionCacheTest, SingleSession) {}

TEST_F(QuicClientSessionCacheTest, MultipleSessions) {}

// Test that when a different TransportParameter is inserted for
// the same server id, the existing entry is removed.
TEST_F(QuicClientSessionCacheTest, DifferentTransportParams) {}

TEST_F(QuicClientSessionCacheTest, DifferentApplicationState) {}

TEST_F(QuicClientSessionCacheTest, BothStatesDifferent) {}

// When the size limit is exceeded, the oldest entry should be erased.
TEST_F(QuicClientSessionCacheTest, SizeLimit) {}

TEST_F(QuicClientSessionCacheTest, ClearEarlyData) {}

// Expired session isn't considered valid and nullptr will be returned upon
// Lookup.
TEST_F(QuicClientSessionCacheTest, Expiration) {}

TEST_F(QuicClientSessionCacheTest, RemoveExpiredEntriesAndClear) {}

}  // namespace
}  // namespace test
}  // namespace quic