#include "third_party/blink/public/common/interest_group/ad_display_size_utils.h"
#include <limits>
#include <string>
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/interest_group/ad_display_size.h"
namespace blink {
namespace {
void RunTest(const std::string& input,
double expected_val,
blink::AdSize::LengthUnit expected_unit) { … }
}
TEST(AdDisplaySizeUtilsTest, ConvertAdSizeUnitToString) { … }
TEST(AdDisplaySizeUtilsTest, ConvertAdSizeToString) { … }
TEST(AdDisplaySizeUtilsTest, ConvertAdDimensionToString) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringWithUnits) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringOnlyNumbers) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNumbersTrailingSpaces) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNumbersLeadingSpaces) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNumbersTrailingLeadingSpaces) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringPixelsTrailingSpace) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringPixelsLeadingSpace) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringPixelsTrailingLeadingSpaces) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeZeroPixel) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNumbersWithDecimal) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNoValue) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNegativeValue) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNumbersLeadingZero) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringSingleDot) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringSingleDotWithUnit) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringPixelsMiddleSpaces) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNumbersTrailingDot) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringNumbersLeadingDot) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringInvalidUnit) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringValueAndUnitSwapped) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringEmptyString) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringSingleSpace) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringMultipleSpaces) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringSpacesInNumbers) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringSpacesInUnit) { … }
TEST(AdDisplaySizeUtilsTest, ParseSizeStringWrongFormat) { … }
TEST(AdDisplaySizeUtilsTest, ValidAdSize) { … }
TEST(AdDisplaySizeUtilsTest, AdSizeInvalidUnits) { … }
TEST(AdDisplaySizeUtilsTest, AdSizeZeroValue) { … }
TEST(AdDisplaySizeUtilsTest, AdSizeNegativeValue) { … }
TEST(AdDisplaySizeUtilsTest, AdSizeInfiniteValue) { … }
}