#include "third_party/blink/renderer/modules/ad_auction/validate_blink_interest_group.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "mojo/public/cpp/bindings/map_traits_wtf_hash_map.h"
#include "mojo/public/cpp/bindings/message.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/interest_group/interest_group.h"
#include "third_party/blink/public/mojom/interest_group/ad_display_size.mojom-blink.h"
#include "third_party/blink/public/mojom/interest_group/interest_group_types.mojom-blink.h"
#include "third_party/blink/public/mojom/interest_group/interest_group_types.mojom.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace blink {
namespace {
constexpr char kOriginString[] = …;
constexpr char kNameString[] = …;
constexpr char kCoordinatorOriginString[] = …;
mojom::blink::InterestGroupAdPtr MakeAdWithUrl(const KURL& url) { … }
}
class ValidateBlinkInterestGroupTest : public testing::Test { … };
TEST_F(ValidateBlinkInterestGroupTest, MinimallyPopulated) { … }
TEST_F(ValidateBlinkInterestGroupTest, FullyPopulated) { … }
TEST_F(ValidateBlinkInterestGroupTest, NonHttpsOriginRejected) { … }
TEST_F(ValidateBlinkInterestGroupTest,
NonHttpsOriginRejectedSellerCapabilities) { … }
TEST_F(ValidateBlinkInterestGroupTest, RejectedUrls) { … }
TEST_F(ValidateBlinkInterestGroupTest,
CrossOriginTrustedBiddingSignalsUrlPermitted) { … }
TEST_F(ValidateBlinkInterestGroupTest, AdRenderUrlValidation) { … }
TEST_F(ValidateBlinkInterestGroupTest, AdComponentRenderUrlValidation) { … }
TEST_F(ValidateBlinkInterestGroupTest, MalformedUrl) { … }
TEST_F(ValidateBlinkInterestGroupTest, TooLarge) { … }
TEST_F(ValidateBlinkInterestGroupTest, TooLargePriorityVector) { … }
TEST_F(ValidateBlinkInterestGroupTest, TooLargePrioritySignalsOverride) { … }
TEST_F(ValidateBlinkInterestGroupTest, TooLargeSellerCapabilities) { … }
TEST_F(ValidateBlinkInterestGroupTest, TooLargeAdSizes) { … }
TEST_F(ValidateBlinkInterestGroupTest, TooLargeSizeGroups) { … }
TEST_F(ValidateBlinkInterestGroupTest, TooLargeAds) { … }
TEST_F(ValidateBlinkInterestGroupTest, InvalidAdSizes) { … }
TEST_F(ValidateBlinkInterestGroupTest, InvalidSizeGroups) { … }
TEST_F(ValidateBlinkInterestGroupTest, AdSizeGroupEmptyNameOrNotInSizeGroups) { … }
TEST_F(ValidateBlinkInterestGroupTest,
AdComponentSizeGroupEmptyNameOrNotInSizeGroups) { … }
TEST_F(ValidateBlinkInterestGroupTest, AdRenderIdTooLong) { … }
TEST_F(ValidateBlinkInterestGroupTest, AdComponentRenderIdTooLong) { … }
TEST_F(ValidateBlinkInterestGroupTest, AdTooManyAllowedReportingOrigins) { … }
TEST_F(ValidateBlinkInterestGroupTest, AdNonHttpsAllowedReportingOrigins) { … }
TEST_F(ValidateBlinkInterestGroupTest, JustAdditionalBidKeyIsValid) { … }
TEST_F(ValidateBlinkInterestGroupTest, AdditionalBidKeyWrongSize) { … }
TEST_F(ValidateBlinkInterestGroupTest,
AdditionalBidKeyAndAdsNotAllowedTogether) { … }
TEST_F(ValidateBlinkInterestGroupTest, AggregationCoordinatorNotHTTPS) { … }
TEST_F(ValidateBlinkInterestGroupTest, AggregationCoordinatorInvalid) { … }
TEST_F(ValidateBlinkInterestGroupTest,
AdditionalBidKeyAndUpdateURLNotAllowedTogether) { … }
TEST_F(ValidateBlinkInterestGroupTest,
MaxTrustedBiddingSignalsURLLengthMustNotBeNegative) { … }
TEST_F(ValidateBlinkInterestGroupTest,
InvalidTrustedBiddingSignalsCoordinator) { … }
}