#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h"
#include "base/containers/span.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/font_test_utilities.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_spacing.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/testing/font_test_base.h"
#include "third_party/blink/renderer/platform/testing/font_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
namespace blink {
namespace {
class FontsHolder : public GarbageCollected<FontsHolder> { … };
}
class ShapeResultTest : public FontTestBase { … };
void ShapeResultTest::TestCopyRangesLatin(const ShapeResult* result) const { … }
void ShapeResultTest::TestCopyRangesArabic(const ShapeResult* result) const { … }
TEST_F(ShapeResultTest, CopyRangeLatin) { … }
TEST_F(ShapeResultTest, CopyRangeLatinMultiRun) { … }
TEST_F(ShapeResultTest, CopyRangeLatinMultiRunWithHoles) { … }
TEST_F(ShapeResultTest, CopyRangeArabic) { … }
TEST_F(ShapeResultTest, CopyRangeArabicMultiRun) { … }
static struct IsStartSafeToBreakData { … } is_start_safe_to_break_data[] = …;
class IsStartSafeToBreakDataTest
: public ShapeResultTest,
public testing::WithParamInterface<IsStartSafeToBreakData> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(IsStartSafeToBreakDataTest, IsStartSafeToBreakData) { … }
TEST_F(ShapeResultTest, AddUnsafeToBreakLtr) { … }
TEST_F(ShapeResultTest, AddUnsafeToBreakRtl) { … }
TEST_F(ShapeResultTest, AddUnsafeToBreakRange) { … }
TEST_F(ShapeResultTest, ComputeInkBoundsWithZeroOffset) { … }
struct TextAutoSpaceTextData { … } text_auto_space_test_data[] = …;
class TextAutoSpaceResultText
: public ShapeResultTest,
public testing::WithParamInterface<TextAutoSpaceTextData> { … };
INSTANTIATE_TEST_SUITE_P(…);
Vector<float> RecordPositionBeforeApplyingSpacing(ShapeResult* result,
wtf_size_t size) { … }
Vector<OffsetWithSpacing, 16> RecordExpectedSpacing(
const std::vector<wtf_size_t>& offsets_data) { … }
TEST_P(TextAutoSpaceResultText, AddAutoSpacingToIdeograph) { … }
TEST_F(ShapeResultTest, DISABLED_ComputeInkBoundsWithNonZeroOffset) { … }
struct CaretPositionForOffsetTestData { … } caret_position_for_offset_test_data[] = …;
class CaretPositionForOffsetTest
: public ShapeResultTest,
public testing::WithParamInterface<CaretPositionForOffsetTestData> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CaretPositionForOffsetTest, CaretPositionForOffsets) { … }
struct CaretOffsetForPositionTestData { … } caret_offset_for_position_test_data[] = …;
class CaretOffsetForPositionTest
: public ShapeResultTest,
public testing::WithParamInterface<CaretOffsetForPositionTestData> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CaretOffsetForPositionTest, OffsetForPositions) { … }
}