chromium/content/browser/interest_group/bidding_and_auction_serializer_unittest.cc

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

#include "content/browser/interest_group/bidding_and_auction_serializer.h"

#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/interest_group/test_interest_group_builder.h"

namespace content {

namespace {

const size_t kEncryptionOverhead =;

constexpr char kOriginStringA[] =;
constexpr char kOriginStringB[] =;
constexpr char kOriginStringC[] =;
constexpr char kOriginStringD[] =;

// Bidder overhead is 1 byte for tag/length of buyer, 14 bytes for buyer, 1 byte
// for tag of serialized data, 1 byte for length of serialized data (length <
// 256).
const size_t kBidderOverhead =;

StorageInterestGroup MakeInterestGroup(blink::InterestGroup interest_group) {}

scoped_refptr<StorageInterestGroups> CreateInterestGroups(url::Origin owner) {}

class BiddingAndAuctionSerializerTest : public testing::Test {};

TEST_F(BiddingAndAuctionSerializerTest, SerializeWithDefaultConfig) {}

TEST_F(BiddingAndAuctionSerializerTest, SerializeWithLargeRequestSize) {}

TEST_F(BiddingAndAuctionSerializerTest, SerializeWithSmallRequestSize) {}

TEST_F(BiddingAndAuctionSerializerTest, SerializeWithTooSmallRequestSize) {}

TEST_F(BiddingAndAuctionSerializerTest, SerializeWithPerOwnerSize) {}

TEST_F(BiddingAndAuctionSerializerTest,
       SerializeWithPerOwnerSizeBiggerThanRequestSize) {}

TEST_F(BiddingAndAuctionSerializerTest, SerializeWithPerOwnerSizeExpands) {}

TEST_F(BiddingAndAuctionSerializerTest, SerializeWithPerOwnerSizeShrinks) {}

TEST_F(BiddingAndAuctionSerializerTest, SerializeWithFixedSizeGroups) {}

// Test that the encrypted request still has the full size even when the
// specified buyers are not on the device.
TEST_F(BiddingAndAuctionSerializerTest, SerializeWithNoGroupsSetBuyersFixed) {}

// Test that the encrypted request still has the full size even when the
// specified buyers are not on the device.
TEST_F(BiddingAndAuctionSerializerTest,
       SerializeWithNoGroupsSetBuyersProportional) {}

class TargetSizeEstimatorTest : public testing::Test {};

TEST_F(TargetSizeEstimatorTest, TotalSizeExceedsSizeT) {}

TEST_F(TargetSizeEstimatorTest, LargeSizeBeforeGroups) {}

TEST_F(TargetSizeEstimatorTest, FixedSizeGroups) {}

TEST_F(TargetSizeEstimatorTest, FixedSizeGroupsShrink) {}

// Specifically designed groups where each iteration in
// TargetSizeEstimator::UpdateUnsizedGroupSizes only removes 1 buyer.
TEST_F(TargetSizeEstimatorTest, EqualWorstCase) {}

// Specifically designed groups where each iteration in
// TargetSizeEstimator::UpdateSizedGroupSizes only removes 1 buyer. Note this is
// the same as the previous test only for sized groups, as equal size is a
// special case of proportional.
TEST_F(TargetSizeEstimatorTest, ProportionalWorstCase) {}

}  // namespace
}  // namespace content