#include "third_party/blink/public/common/interest_group/auction_config_mojom_traits.h"
#include <limits>
#include <optional>
#include <string>
#include <tuple>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "base/unguessable_token.h"
#include "base/uuid.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/numeric/int128.h"
#include "third_party/blink/common/interest_group/auction_config_test_util.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/interest_group/auction_config.h"
#include "third_party/blink/public/common/interest_group/seller_capabilities.h"
#include "third_party/blink/public/mojom/interest_group/interest_group_types.mojom.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace blink {
namespace {
constexpr char kPerBuyerSignals[] = …;
constexpr char kSellerSignals[] = …;
constexpr char kAuctionSignals[] = …;
constexpr char kBundleUrl[] = …;
constexpr char kPrefix[] = …;
bool SerializeAndDeserialize(const AuctionConfig& auction_config) { … }
template <class MojoType, class PromiseValue>
bool SerializeAndDeserialize(
const AuctionConfig::MaybePromise<PromiseValue>& in) { … }
bool SerializeAndDeserialize(const AuctionConfig::AdKeywordReplacement& in) { … }
bool SerializeAndDeserialize(const AuctionConfig::BuyerTimeouts& in) { … }
bool SerializeAndDeserialize(const AuctionConfig::BuyerCurrencies& in) { … }
bool SerializeAndDeserialize(const AdCurrency& in) { … }
bool SerializeAndDeserialize(const AuctionConfig::ServerResponseConfig& in) { … }
TEST(AuctionConfigMojomTraitsTest, Empty) { … }
TEST(AuctionConfigMojomTraitsTest, Basic) { … }
TEST(AuctionConfigMojomTraitsTest, SellerNotHttps) { … }
TEST(AuctionConfigMojomTraitsTest, SellerDecisionUrlMismatch) { … }
TEST(AuctionConfigMojomTraitsTest, SellerDecisionAndTrustedSignalsUrlsTooLong) { … }
TEST(AuctionConfigMojomTraitsTest, SellerScoringSignalsUrlMismatch) { … }
TEST(AuctionConfigMojomTraitsTest,
SellerScoringSignalsUrlCrossOriginPermitted) { … }
TEST(AuctionConfigMojomTraitsTest, TrustedScoringSignalsFields) { … }
TEST(AuctionConfigMojomTraitsTest, FullConfig) { … }
TEST(AuctionConfigMojomTraitsTest,
perBuyerPrioritySignalsCannotOverrideBrowserSignals) { … }
TEST(AuctionConfigMojomTraitsTest,
allBuyersPrioritySignalsCannotOverrideBrowserSignals) { … }
TEST(AuctionConfigMojomTraitsTest, SerializeAndDeserializeNonFinite) { … }
TEST(AuctionConfigMojomTraitsTest, BuyerNotHttps) { … }
TEST(AuctionConfigMojomTraitsTest, BuyerNotHttpsMultipleBuyers) { … }
TEST(AuctionConfigMojomTraitsTest, ComponentAuctionUrlHttps) { … }
TEST(AuctionConfigMojomTraitsTest, ComponentAuctionTooDeep) { … }
TEST(AuctionConfigMojomTraitsTest, ComponentAuctionWithNonce) { … }
TEST(AuctionConfigMojomTraitsTest,
TopLevelAuctionHasBuyersAndComponentAuction) { … }
TEST(AuctionConfigMojomTraitsTest, ComponentAuctionSuccessSingleBasic) { … }
TEST(AuctionConfigMojomTraitsTest, ComponentAuctionSuccessMultipleFull) { … }
TEST(AuctionConfigMojomTraitsTest, DuplicateAllSlotsRequestedSizes) { … }
TEST(AuctionConfigMojomTraitsTest, MaxTrustedScoringSignalsUrlLength) { … }
TEST(AuctionConfigMojomTraitsTest, TrustedScoringSignalsCoordinator) { … }
TEST(AuctionConfigMojomTraitsTest,
DirectFromSellerSignalsPrefixWithQueryString) { … }
TEST(AuctionConfigMojomTraitsTest, DirectFromSellerSignalsBuyerNotPresent) { … }
TEST(AuctionConfigMojomTraitsTest,
DirectFromSellerSignalsNoDirectFromSellerSignals) { … }
TEST(AuctionConfigMojomTraitsTest, DirectFromSellerSignalsNoPerBuyerSignals) { … }
TEST(AuctionConfigMojomTraitsTest, DirectFromSellerSignalsNoSellerSignals) { … }
TEST(AuctionConfigMojomTraitsTest, DirectFromSellerSignalsNoAuctionSignals) { … }
TEST(AuctionConfigMojomTraitsTest, DirectFromSellerSignalsHeaderAdSlot) { … }
TEST(AuctionConfigMojomTraitsTest,
DirectFromSellerSignalsCantHaveBothBundlesAndHeaderAdSlot) { … }
TEST(AuctionConfigMojomTraitsTest,
DirectFromSellerSignalsCantHaveBothBundlesAndHeaderAdSlotPromise) { … }
TEST(AuctionConfigMojomTraitsTest, MaybePromiseJson) { … }
TEST(AuctionConfigMojomTraitsTest, MaybePromisePerBuyerSignals) { … }
TEST(AuctionConfigMojomTraitsTest,
MaybePromiseDeprecatedRenderURLReplacements) { … }
TEST(AuctionConfigMojomTraitsTest, DeprecatedRenderURLReplacements) { … }
TEST(AuctionConfigMojomTraitsTest,
DeprecatedRenderURLReplacementsBadFormatting) { … }
TEST(AuctionConfigMojomTraitsTest, SellerTimeout) { … }
TEST(AuctionConfigMojomTraitsTest, BuyerTimeouts) { … }
TEST(AuctionConfigMojomTraitsTest, MaybePromiseBuyerTimeouts) { … }
TEST(AuctionConfigMojomTraitsTest, ReportingTimeout) { … }
TEST(AuctionConfigMojomTraitsTest, BuyerCurrencies) { … }
TEST(AuctionConfigMojomTraitsTest, AdCurrency) { … }
TEST(AuctionConfigMojomTraitsTest, MaybePromiseDirectFromSellerSignals) { … }
TEST(AuctionConfigMojomTraitsTest, ServerResponseConfig) { … }
TEST(AuctionConfigMojomTraitsTest, AdditionalBidsNoNonce) { … }
TEST(AuctionConfigMojomTraitsTest, AdditionalBidsNoInterestGroupBuyers) { … }
TEST(AuctionConfigMojomTraitsTest, AdditionalBidsEmptyInterestGroupBuyers) { … }
class AuctionConfigMojomTraitsDirectFromSellerSignalsTest
: public ::testing::TestWithParam<std::tuple<const char*, const char*>> { … };
TEST_P(AuctionConfigMojomTraitsDirectFromSellerSignalsTest, NotHttps) { … }
TEST_P(AuctionConfigMojomTraitsDirectFromSellerSignalsTest, WrongOrigin) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}