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

// Copyright 2017 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_bloberizer.h"

#include <memory>
#include <optional>

#include "skia/ext/font_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/fonts/character_range.h"
#include "third_party/blink/renderer/platform/fonts/font.h"
#include "third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h"
#include "third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.h"
#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/fonts/text_fragment_paint_info.h"
#include "third_party/blink/renderer/platform/fonts/text_run_paint_info.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 {

// Creating minimal test SimpleFontData objects,
// the font won't have any glyphs, but that's okay.
static SimpleFontData* CreateTestSimpleFontData(bool force_rotation = false) {}

class ShapeResultBloberizerTest : public FontTestBase {};

struct ExpectedRun {};
ExpectedBlob;

struct ExpectedRange {};

void CheckBlobBuffer(const ShapeResultBloberizer::BlobBuffer& blob_buffer,
                     const std::vector<ExpectedBlob>& expected_blobs) {}

}  // anonymous namespace

TEST_F(ShapeResultBloberizerTest, StartsEmpty) {}

TEST_F(ShapeResultBloberizerTest, StoresGlyphsOffsets) {}

TEST_F(ShapeResultBloberizerTest, StoresGlyphsVerticalOffsets) {}

TEST_F(ShapeResultBloberizerTest, MixedBlobRotation) {}

// Tests that filling a glyph buffer for a specific range returns the same
// results when shaping word by word as when shaping the full run in one go.
TEST_F(ShapeResultBloberizerTest, CommonAccentLeftToRightFillGlyphBuffer) {}

// Tests that filling a glyph buffer for a specific range returns the same
// results when shaping word by word as when shaping the full run in one go.
TEST_F(ShapeResultBloberizerTest, CommonAccentRightToLeftFillGlyphBuffer) {}

TEST_F(ShapeResultBloberizerTest, CommonAccentRightToLeftFillGlyphBufferNG) {}

TEST_F(ShapeResultBloberizerTest, FourByteUtf8CodepointsNG) {}

TEST_F(ShapeResultBloberizerTest, OffsetIntoTrailingSurrogateNG) {}

TEST_F(ShapeResultBloberizerTest, LatinMultRunNG) {}

TEST_F(ShapeResultBloberizerTest, SupplementaryMultiRunNG) {}

// Tests that runs with zero glyphs (the ZWJ non-printable character in this
// case) are handled correctly. This test passes if it does not cause a crash.
TEST_F(ShapeResultBloberizerTest, SubRunWithZeroGlyphs) {}

}  // namespace blink