chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_test.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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> {};
}  // namespace

class ShapeResultTest : public FontTestBase {};

void ShapeResultTest::TestCopyRangesLatin(const ShapeResult* result) const {}

void ShapeResultTest::TestCopyRangesArabic(const ShapeResult* result) const {}

TEST_F(ShapeResultTest, CopyRangeLatin) {}

// Identical to CopyRangeLatin except the source range shape result is split
// into multiple runs to test the handling of ranges spanning runs and runs
// spanning ranges.
TEST_F(ShapeResultTest, CopyRangeLatinMultiRun) {}

TEST_F(ShapeResultTest, CopyRangeLatinMultiRunWithHoles) {}

TEST_F(ShapeResultTest, CopyRangeArabic) {}

// Identical to CopyRangeArabic except the source range shape result is split
// into multiple runs to test the handling of ranges spanning runs and runs
// spanning ranges.
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) {}

// Tests the spacing should be appended at the correct positions.
TEST_P(TextAutoSpaceResultText, AddAutoSpacingToIdeograph) {}

// TDOO(yosin): We should use a font including U+0A81 or other code point
// having non-zero glyph offset.
TEST_F(ShapeResultTest, DISABLED_ComputeInkBoundsWithNonZeroOffset) {}

// Tests for CaretPositionForOffset
struct CaretPositionForOffsetTestData {} caret_position_for_offset_test_data[] =;
class CaretPositionForOffsetTest
    : public ShapeResultTest,
      public testing::WithParamInterface<CaretPositionForOffsetTestData> {};
INSTANTIATE_TEST_SUITE_P();

TEST_P(CaretPositionForOffsetTest, CaretPositionForOffsets) {}

// Tests for OffsetForPosition
struct CaretOffsetForPositionTestData {} caret_offset_for_position_test_data[] =;
class CaretOffsetForPositionTest
    : public ShapeResultTest,
      public testing::WithParamInterface<CaretOffsetForPositionTestData> {};
INSTANTIATE_TEST_SUITE_P();

TEST_P(CaretOffsetForPositionTest, OffsetForPositions) {}

}  // namespace blink