chromium/third_party/blink/renderer/core/editing/iterators/text_iterator_test.cc

/*
 * Copyright (c) 2013, Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/core/editing/iterators/text_iterator.h"

#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/position.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/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"

namespace blink {
namespace text_iterator_test {

TextIteratorBehavior EmitsImageAltTextBehavior() {}

TextIteratorBehavior EntersTextControlsBehavior() {}

TextIteratorBehavior EntersOpenShadowRootsBehavior() {}

TextIteratorBehavior EmitsObjectReplacementCharacterBehavior() {}

TextIteratorBehavior EmitsSmallXForTextSecurityBehavior() {}

TextIteratorBehavior EmitsCharactersBetweenAllVisiblePositionsBehavior() {}

TextIteratorBehavior EmitsSpaceForNbspBehavior() {}

struct DOMTree : NodeTraversal {};

struct FlatTree : FlatTreeTraversal {};

class TextIteratorTest : public EditingTestBase {};

template <typename Tree>
std::string TextIteratorTest::Iterate(
    const TextIteratorBehavior& iterator_behavior) {}

template <typename Tree>
std::string TextIteratorTest::IteratePartial(
    const typename Tree::PositionType& start,
    const typename Tree::PositionType& end,
    const TextIteratorBehavior& iterator_behavior) {}

template <typename Tree>
std::string TextIteratorTest::IterateWithIterator(
    typename Tree::TextIteratorType& iterator) {}

Range* TextIteratorTest::GetBodyRange() const {}

TEST_F(TextIteratorTest, BitStackOverflow) {}

TEST_F(TextIteratorTest, BasicIteration) {}

TEST_F(TextIteratorTest, EmitsSmallXForTextSecurity) {}

TEST_F(TextIteratorTest, IgnoreAltTextInTextControls) {}

TEST_F(TextIteratorTest, DisplayAltTextInImageControls) {}

TEST_F(TextIteratorTest, NotEnteringTextControls) {}

TEST_F(TextIteratorTest, EnteringTextControlsWithOption) {}

TEST_F(TextIteratorTest, EnteringTextControlsWithOptionComplex) {}

TEST_F(TextIteratorTest, NotEnteringShadowTree) {}

TEST_F(TextIteratorTest, NotEnteringShadowTreeWithNestedShadowTrees) {}

TEST_F(TextIteratorTest, NotEnteringShadowTreeWithContentInsertionPoint) {}

TEST_F(TextIteratorTest, EnteringShadowTreeWithOption) {}

TEST_F(TextIteratorTest, EnteringShadowTreeWithNestedShadowTreesWithOption) {}

TEST_F(TextIteratorTest,
       EnteringShadowTreeWithContentInsertionPointWithOption) {}

TEST_F(TextIteratorTest, StartingAtNodeInShadowRoot) {}

TEST_F(TextIteratorTest, FinishingAtNodeInShadowRoot) {}

TEST_F(TextIteratorTest, FullyClipsContents) {}

// http://crbug.com/1194349
// See also CachedTextInputInfoTest.PlaceholderBRInTextArea
TEST_F(TextIteratorTest, PlaceholderBRInTextArea) {}

TEST_F(TextIteratorTest, IgnoresContainerClip) {}

TEST_F(TextIteratorTest, FullyClippedContentsDistributed) {}

TEST_F(TextIteratorTest, IgnoresContainersClipDistributed) {}

TEST_F(TextIteratorTest, EmitsReplacementCharForInput) {}

TEST_F(TextIteratorTest, RangeLengthWithReplacedElements) {}

TEST_F(TextIteratorTest, RangeLengthInMultilineSpan) {}

TEST_F(TextIteratorTest, RangeLengthBasic) {}

TEST_F(TextIteratorTest, RangeLengthWithFirstLetter) {}

TEST_F(TextIteratorTest, RangeLengthWithFirstLetterMultipleLeadingSpaces) {}

TEST_F(TextIteratorTest, TrainlingSpace) {}

TEST_F(TextIteratorTest, WhitespaceCollapseForReplacedElements) {}

TEST_F(TextIteratorTest, characterAt) {}

// Regression test for crbug.com/630921
TEST_F(TextIteratorTest, EndingConditionWithDisplayNone) {}

// Trickier regression test for crbug.com/630921
TEST_F(TextIteratorTest, EndingConditionWithDisplayNoneInShadowTree) {}

TEST_F(TextIteratorTest, PreserveLeadingSpace) {}

// We used to have a bug where the leading space was duplicated if we didn't
// emit alt text, this tests for that bug
TEST_F(TextIteratorTest, PreserveLeadingSpaceWithoutEmittingAltText) {}

TEST_F(TextIteratorTest, PreserveOnlyLeadingSpace) {}

TEST_F(TextIteratorTest, StartAtFirstLetter) {}

TEST_F(TextIteratorTest, StartInMultiCharFirstLetterWithCollapsedSpace) {}

TEST_F(TextIteratorTest, StartAndEndInMultiCharFirstLetterWithCollapsedSpace) {}

TEST_F(TextIteratorTest, StartAtRemainingText) {}

TEST_F(TextIteratorTest, StartAtFirstLetterInPre) {}

TEST_F(TextIteratorTest, StartInMultiCharFirstLetterInPre) {}

TEST_F(TextIteratorTest, StartAndEndInMultiCharFirstLetterInPre) {}

// crbug.com/1175482
TEST_F(TextIteratorTest, FirstLetterAndRemainingAreDifferentBlocks) {}

TEST_F(TextIteratorTest, StartAtRemainingTextInPre) {}

TEST_F(TextIteratorTest, VisitsDisplayContentsChildren) {}

TEST_F(TextIteratorTest, BasicIterationEmptyContent) {}

TEST_F(TextIteratorTest, BasicIterationSingleCharacter) {}

TEST_F(TextIteratorTest, BasicIterationSingleDiv) {}

TEST_F(TextIteratorTest, BasicIterationMultipleDivs) {}

TEST_F(TextIteratorTest, BasicIterationMultipleDivsWithStyle) {}

TEST_F(TextIteratorTest, BasicIterationMultipleDivsWithChildren) {}

TEST_F(TextIteratorTest, BasicIterationOnChildrenWithStyle) {}

TEST_F(TextIteratorTest, BasicIterationInput) {}

TEST_F(TextIteratorTest, BasicIterationInputiWithBr) {}

TEST_F(TextIteratorTest, FloatLeft) {}

TEST_F(TextIteratorTest, FloatRight) {}

TEST_F(TextIteratorTest, InlineBlock) {}

TEST_F(TextIteratorTest, NoZWSForSpaceAfterNoWrapSpace) {}

TEST_F(TextIteratorTest, PositionInShadowTree) {}

TEST_F(TextIteratorTest, HiddenFirstLetter) {}

TEST_F(TextIteratorTest, HiddenFirstLetterInPre) {}

TEST_F(TextIteratorTest, TextOffsetMappingAndFlatTree) {}

TEST_F(TextIteratorTest, EmitsSpaceForNbsp) {}

TEST_F(TextIteratorTest, IterateWithLockedSubtree) {}

TEST_F(TextIteratorTest, IterateRangeEndingAtLockedSubtree) {}

// http://crbug.com/1203786
TEST_F(TextIteratorTest, RangeLengthWithSoftLineWrap) {}

// http://crbug.com/41350470
TEST_F(TextIteratorTest, BasicIterationWithoutLayoutBetweenTextNode) {}

}  // namespace text_iterator_test
}  // namespace blink