chromium/third_party/blink/renderer/core/editing/visible_units_test.cc

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

#include "third_party/blink/renderer/core/editing/visible_units.h"

#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/position_with_affinity.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/testing/editing_test_base.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/layout/layout_text_fragment.h"

namespace blink {
namespace visible_units_test {

PositionWithAffinity PositionWithAffinityInDOMTree(
    Node& anchor,
    int offset,
    TextAffinity affinity = TextAffinity::kDownstream) {}

VisiblePosition CreateVisiblePositionInDOMTree(
    Node& anchor,
    int offset,
    TextAffinity affinity = TextAffinity::kDownstream) {}

PositionInFlatTreeWithAffinity PositionWithAffinityInFlatTree(
    Node& anchor,
    int offset,
    TextAffinity affinity = TextAffinity::kDownstream) {}

VisiblePositionInFlatTree CreateVisiblePositionInFlatTree(
    Node& anchor,
    int offset,
    TextAffinity affinity = TextAffinity::kDownstream) {}

class VisibleUnitsTest : public EditingTestBase {};

TEST_F(VisibleUnitsTest, caretMinOffset) {}

TEST_F(VisibleUnitsTest, caretMinOffsetWithFirstLetter) {}

TEST_F(VisibleUnitsTest, characterAfter) {}

// http://crbug.com/1176202
TEST_F(VisibleUnitsTest, CanonicalPositionOfWithBefore) {}

TEST_F(VisibleUnitsTest, canonicalPositionOfWithHTMLHtmlElement) {}

// For http://crbug.com/695317
TEST_F(VisibleUnitsTest, canonicalPositionOfWithInputElement) {}

// http://crbug.com/1116214
TEST_F(VisibleUnitsTest, canonicalPositionOfWithCrossBlockFlowlement) {}

TEST_F(VisibleUnitsTest, characterBefore) {}

TEST_F(VisibleUnitsTest, endOfDocument) {}

TEST_F(VisibleUnitsTest,
       AdjustForwardPositionToAvoidCrossingEditingBoundariesNestedEditable) {}

TEST_F(VisibleUnitsTest, isEndOfEditableOrNonEditableContent) {}

TEST_F(VisibleUnitsTest, isEndOfEditableOrNonEditableContentWithInput) {}

TEST_F(VisibleUnitsTest, IsVisuallyEquivalentCandidateWithHTMLHtmlElement) {}

TEST_F(VisibleUnitsTest, isVisuallyEquivalentCandidateWithHTMLBodyElement) {}

TEST_F(VisibleUnitsTest, isVisuallyEquivalentCandidateWithDocument) {}

TEST_F(VisibleUnitsTest, mostBackwardCaretPositionAfterAnchor) {}

TEST_F(VisibleUnitsTest, mostBackwardCaretPositionFirstLetter) {}

TEST_F(VisibleUnitsTest, mostBackwardCaretPositionFirstLetterSplit) {}

TEST_F(VisibleUnitsTest, mostForwardCaretPositionAfterAnchor) {}

// http://crbug.com/1348816
TEST_F(VisibleUnitsTest, MostBackwardCaretPositionBeforeSvg) {}

// http://crbug.com/1348816
TEST_F(VisibleUnitsTest, MostForwardCaretPositionBeforeSvg) {}

TEST_F(VisibleUnitsTest, mostForwardCaretPositionFirstLetter) {}

TEST_F(VisibleUnitsTest, nextPositionOf) {}

TEST_F(VisibleUnitsTest, nextPositionOfTable) {}

TEST_F(VisibleUnitsTest, previousPositionOf) {}

TEST_F(VisibleUnitsTest, previousPositionOfOneCharPerLine) {}

TEST_F(VisibleUnitsTest, previousPositionOfNoPreviousPosition) {}

TEST_F(VisibleUnitsTest, rendersInDifferentPositionAfterAnchor) {}

TEST_F(VisibleUnitsTest, rendersInDifferentPositionAfterAnchorWithHidden) {}

TEST_F(VisibleUnitsTest,
       rendersInDifferentPositionAfterAnchorWithDifferentLayoutObjects) {}

TEST_F(VisibleUnitsTest, renderedOffset) {}

TEST_F(VisibleUnitsTest, startOfDocument) {}

TEST_F(VisibleUnitsTest,
       endsOfNodeAreVisuallyDistinctPositionsWithInvisibleChild) {}

TEST_F(VisibleUnitsTest,
       endsOfNodeAreVisuallyDistinctPositionsWithEmptyLayoutChild) {}

// Regression test for crbug.com/675429
TEST_F(VisibleUnitsTest,
       canonicalizationWithCollapsedSpaceAndIsolatedCombiningCharacter) {}

TEST_F(VisibleUnitsTest, MostForwardCaretPositionWithInvisibleFirstLetter) {}

// Regression test for crbug.com/1172091
TEST_F(VisibleUnitsTest, MostBackwardOrForwardCaretPositionWithBrInOptgroup) {}

// http://crbug.com/1134470
TEST_F(VisibleUnitsTest, SnapBackwardWithZeroWidthSpace) {}
TEST_F(VisibleUnitsTest, SnapForwardWithImg) {}

TEST_F(VisibleUnitsTest, SnapForwardWithInput) {}

TEST_F(VisibleUnitsTest, SnapForwardWithSelect) {}

// From ReplaceSelectionCommandTest.TableAndImages)
TEST_F(VisibleUnitsTest, SnapForwardWithTableAndImages) {}

// http://crbug.com/1134470
TEST_F(VisibleUnitsTest, SnapForwardWithZeroWidthSpace) {}

TEST_F(VisibleUnitsTest, FirstRectForRangeHorizontal) {}

TEST_F(VisibleUnitsTest, FirstRectForRangeHorizontalWrap) {}

TEST_F(VisibleUnitsTest, FirstRectForRangeVertical) {}

TEST_F(VisibleUnitsTest, FirstRectForRangeVerticalWrap) {}

}  // namespace visible_units_test
}  // namespace blink